Skip to main content

SystemFn

Struct SystemFn 

Source
pub struct SystemFn<F, Params: Param> { /* private fields */ }
Expand description

Concrete system wrapper produced by IntoSystem.

Stores the function, pre-resolved parameter state, and a diagnostic name. Users rarely name this type directly — use Box<dyn System> for type-erased storage, or let inference handle the concrete type.

Trait Implementations§

Source§

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

Source§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.
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§

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

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

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

Returns the system’s name for diagnostics.

Auto Trait Implementations§

§

impl<F, Params> Freeze for SystemFn<F, Params>
where F: Freeze, <Params as Param>::State: Freeze,

§

impl<F, Params> RefUnwindSafe for SystemFn<F, Params>
where F: RefUnwindSafe, <Params as Param>::State: RefUnwindSafe,

§

impl<F, Params> Send for SystemFn<F, Params>
where F: Send,

§

impl<F, Params> Sync for SystemFn<F, Params>
where F: Sync, <Params as Param>::State: Sync,

§

impl<F, Params> Unpin for SystemFn<F, Params>
where F: Unpin, <Params as Param>::State: Unpin,

§

impl<F, Params> UnsafeUnpin for SystemFn<F, Params>
where F: UnsafeUnpin, <Params as Param>::State: UnsafeUnpin,

§

impl<F, Params> UnwindSafe for SystemFn<F, Params>
where F: UnwindSafe, <Params as Param>::State: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.