Skip to main content

System

Trait System 

Source
pub trait System: Send {
    // Required method
    fn run(&mut self, world: &mut World) -> bool;

    // Provided method
    fn name(&self) -> &'static str { ... }
}
Expand description

Object-safe dispatch trait for reconciliation systems.

Returns bool to control downstream propagation in a DAG scheduler. true means “my outputs changed, run downstream systems.” false means “nothing changed, skip downstream.”

§Difference from Handler

HandlerSystem
TriggerPer-eventPer-scheduler-pass
Event paramYes (E)No
Return()bool
PurposeReactReconcile

Required Methods§

Source

fn run(&mut self, world: &mut World) -> bool

Run this system. Returns true if downstream systems should run.

Provided Methods§

Source

fn name(&self) -> &'static str

Returns the system’s name for diagnostics.

Implementors§

Source§

impl<F: Send + 'static, P0: Param + 'static> System for SystemFn<F, (P0,)>
where for<'a> &'a mut F: FnMut(P0) -> bool + FnMut(P0::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static> System for SystemFn<F, (P0, P1)>
where for<'a> &'a mut F: FnMut(P0, P1) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static> System for SystemFn<F, (P0, P1, P2)>
where for<'a> &'a mut F: FnMut(P0, P1, P2) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static> System for SystemFn<F, (P0, P1, P2, P3)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static> System for SystemFn<F, (P0, P1, P2, P3, P4)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static> System for SystemFn<F, (P0, P1, P2, P3, P4, P5)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static, P6: Param + 'static> System for SystemFn<F, (P0, P1, P2, P3, P4, P5, P6)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5, P6) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>, P6::Item<'a>) -> bool,

Source§

impl<F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static, P6: Param + 'static, P7: Param + 'static> System for SystemFn<F, (P0, P1, P2, P3, P4, P5, P6, P7)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5, P6, P7) -> bool + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>, P6::Item<'a>, P7::Item<'a>) -> bool,

Source§

impl<F: FnMut() -> bool + Send + 'static> System for SystemFn<F, ()>