bevy/crates/bevy_ecs/src/system/commands
Federico Rinaldi fc07557913 Clarify Commands API docs (#5938)
# Objective

- Make people stop believing that commands are applied immediately (hopefully).
- Close #5913.
- Alternative to #5930.

## Solution

I added the clause “to perform impactful changes to the `World`” to the first line to subliminally help the reader accept the fact that some operations cannot be performed immediately without messing up everything.

Then I explicitely said that applying a command requires exclusive `World` access, and finally I proceeded to show when these commands are automatically applied.

I also added a brief paragraph about how commands can be applied manually, if they want.

---

### Further possibilities

If you agree, we can also change the text of the method documentation (in a separate PR) to stress about enqueueing an action instead of just performing it. For example, in `Commands::spawn`:

> Creates a new `Entity`

would be changed to something like:

> Issues a `Command` to spawn a new `Entity`

This may even have a greater effect, since when typing in an IDE, the docs of the method pop up and the programmer can read them on the fly.
2022-09-12 01:06:09 +00:00
..
command_queue.rs add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
mod.rs Clarify Commands API docs (#5938) 2022-09-12 01:06:09 +00:00
parallel_scope.rs Update codebase to use IntoIterator where possible. (#5269) 2022-07-11 15:28:50 +00:00