Trait rfw::ecs::prelude::System [−][src]
pub trait System: 'static + Send + Sync { type In; type Out; fn name(&self) -> Cow<'static, str>; fn id(&self) -> SystemId; 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 AppBuilder::add_system(my_system.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
Required methods
fn new_archetype(&mut self, archetype: &Archetype)
fn component_access(&self) -> &Access<ComponentId>
fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>
unsafe fn run_unsafe(&mut self, input: Self::In, world: &World) -> Self::Out
unsafe fn run_unsafe(&mut self, input: Self::In, world: &World) -> Self::Out
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 archetype_component_access()
fn apply_buffers(&mut self, world: &mut World)
fn initialize(&mut self, _world: &mut World)
fn check_change_tick(&mut self, change_tick: u32)
Provided methods
Implementors
impl<In, Out, Param, Marker, F> System for FunctionSystem<In, Out, Param, Marker, F> where
Param: SystemParam + 'static,
F: SystemParamFunction<In, Out, Param, Marker> + Send + Sync + 'static,
In: 'static,
Out: 'static,
Marker: 'static,