Trait bevy_internal::ecs::system::System[][src]

pub trait System: 'static + Send + Sync {
    type In;
    type Out;
    fn name(&self) -> Cow<'static, str>;
fn new_archetype(&mut self, archetype: &Archetype);
fn component_access(&self) -> &Access<ComponentId>;
fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>;
fn is_send(&self) -> bool;
unsafe fn run_unsafe(&mut self, input: Self::In, world: &World) -> Self::Out;
fn apply_buffers(&mut self, world: &mut World);
fn initialize(&mut self, _world: &mut World);
fn check_change_tick(&mut self, change_tick: u32); fn run(&mut self, input: Self::In, world: &mut World) -> Self::Out { ... } }
Expand description

An ECS system that can be added to a Schedule

Systems are functions with all arguments implementing SystemParam.

Systems are added to an application using App::add_system(my_system) or similar methods, and will generally run once per pass of the main loop.

Systems are executed in parallel, in opportunistic order; data access is managed automatically. It’s possible to specify explicit execution order between specific systems, see SystemDescriptor.

Associated Types

The system’s input. See In for FunctionSystems.

The system’s output.

Required methods

Returns the system’s name.

Register a new archetype for this system.

Returns the system’s component Access.

Returns the system’s archetype component Access.

Returns true if the system is Send.

Runs the system with the given input in the world. Unlike System::run, this function takes a shared reference to World and may therefore break Rust’s aliasing rules, making it unsafe to call.

Safety

This might access world and resources in an unsafe manner. This should only be called in one of the following contexts: 1. This system is the only system running on the given world across all threads. 2. This system only runs in parallel with other systems that do not conflict with the System::archetype_component_access().

Initialize the system.

Provided methods

Runs the system with the given input in the world.

Implementors