Skip to main content

IntoSystem

Trait IntoSystem 

Source
pub trait IntoSystem<Marker>: SealedSystem<Marker> { }
Expand description

A function that can be added to a Schedule as a system.

Implemented for functions (and closures) of up to 8 SystemParams returning a SystemOutput; Marker only tells the implementations apart. The trait is sealed.

use pragma_ecs::{IntoSystem, Res, View};

struct Speed(f32);

fn movement(_: View<&mut f32>, _: Res<Speed>) {}

fn assert_system<M>(_: impl IntoSystem<M>) {}
assert_system(movement);

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Func, Out, P0, P1, P2, P3, P4, P5, P6, P7> IntoSystem<fn(P0, P1, P2, P3, P4, P5, P6, P7) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2, P3, P4, P5, P6, P7) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>, <P3 as SystemParam>::Item<'_, '_>, <P4 as SystemParam>::Item<'_, '_>, <P5 as SystemParam>::Item<'_, '_>, <P6 as SystemParam>::Item<'_, '_>, <P7 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static, P6: SystemParam + 'static, P7: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1, P2, P3, P4, P5, P6> IntoSystem<fn(P0, P1, P2, P3, P4, P5, P6) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2, P3, P4, P5, P6) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>, <P3 as SystemParam>::Item<'_, '_>, <P4 as SystemParam>::Item<'_, '_>, <P5 as SystemParam>::Item<'_, '_>, <P6 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static, P6: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1, P2, P3, P4, P5> IntoSystem<fn(P0, P1, P2, P3, P4, P5) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2, P3, P4, P5) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>, <P3 as SystemParam>::Item<'_, '_>, <P4 as SystemParam>::Item<'_, '_>, <P5 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1, P2, P3, P4> IntoSystem<fn(P0, P1, P2, P3, P4) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2, P3, P4) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>, <P3 as SystemParam>::Item<'_, '_>, <P4 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1, P2, P3> IntoSystem<fn(P0, P1, P2, P3) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2, P3) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>, <P3 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1, P2> IntoSystem<fn(P0, P1, P2) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1, P2) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>, <P2 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static,

Source§

impl<Func, Out, P0, P1> IntoSystem<fn(P0, P1) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0, P1) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>, <P1 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static, P1: SystemParam + 'static,

Source§

impl<Func, Out, P0> IntoSystem<fn(P0) -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut(P0) -> Out + FnMut(<P0 as SystemParam>::Item<'_, '_>) -> Out, Out: SystemOutput + 'static, P0: SystemParam + 'static,

Source§

impl<Func, Out> IntoSystem<fn() -> Out> for Func
where Func: Send + 'static, for<'a> &'a mut Func: FnMut() -> Out, Out: SystemOutput + 'static,