Skip to content

Commit

Permalink
fix up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-Fenner committed Nov 12, 2023
1 parent 90eaaa9 commit dc4b380
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,23 @@ impl<'w, 's> Commands<'w, 's> {
/// Running slow systems can become a bottleneck.
///
/// Calls [`World::run_system`](crate::system::World::run_system).
///
/// There is no way to get the output of a system when run as a command, because the
/// execution of the system happens later. To get the output of a system, use
/// [`World::run_system`] or [`World::run_system_with_input`] instead of running the system as a command.
pub fn run_system(&mut self, id: SystemId) {
self.run_system_with_input(id, ())
self.run_system_with_input(id, ());
}

/// Runs the system corresponding to the given [`SystemId`].
/// Systems are ran in an exclusive and single threaded way.
/// Running slow systems can become a bottleneck.
///
/// Calls [`World::run_system_with_input`](crate::system::World::run_system_with_input).
///
/// There is no way to get the output of a system when run as a command, because the
/// execution of the system happens later. To get the output of a system, use
/// [`World::run_system`] or [`World::run_system_with_input`] instead of running the system as a command.
pub fn run_system_with_input<I: 'static + Send>(&mut self, id: SystemId<I>, input: I) {
self.queue
.push(RunSystemWithInput::new_with_input(id, input));
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/system/system_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl World {
///
/// There is no way to get the output of a system when run as a command, because the
/// execution of the system happens later. To get the output of a system, use
/// [World::run_system] or [World::run_system_with_input] instead of running the system as a command.
/// [`World::run_system`] or [`World::run_system_with_input`] instead of running the system as a command.
#[derive(Debug, Clone)]
pub struct RunSystemWithInput<I: 'static> {
system_id: SystemId<I>,
Expand All @@ -326,7 +326,7 @@ pub struct RunSystemWithInput<I: 'static> {
///
/// There is no way to get the output of a system when run as a command, because the
/// execution of the system happens later. To get the output of a system, use
/// [World::run_system] or [World::run_system_with_input] instead of running the system as a command.
/// [`World::run_system`] or [`World::run_system_with_input`] instead of running the system as a command.
pub type RunSystem = RunSystemWithInput<()>;

impl RunSystem {
Expand Down

0 comments on commit dc4b380

Please sign in to comment.