Skip to main content

SystemInput

Trait SystemInput 

pub trait SystemInput: Sized {
    type Param<'i>: SystemInput;
    type Inner<'i>;

    // Required method
    fn wrap(this: Self::Inner<'_>) -> Self::Param<'_>;
}
Expand description

Trait for types that can be used as input to Systems.

Provided implementations are:

For advanced usecases, you can implement this trait for your own types.

§Examples

§Tuples of SystemInputs

use bevy_ecs::prelude::*;

fn add((InMut(a), In(b)): (InMut<usize>, In<usize>)) {
    *a += b;
}

Required Associated Types§

type Param<'i>: SystemInput

The wrapper input type that is defined as the first argument to FunctionSystems.

type Inner<'i>

The inner input type that is passed to functions that run systems, such as System::run.

Required Methods§

fn wrap(this: Self::Inner<'_>) -> Self::Param<'_>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl SystemInput for ()

§

type Param<'i> = ()

§

type Inner<'i> = ()

§

fn wrap(this: <() as SystemInput>::Inner<'_>) -> <() as SystemInput>::Param<'_>

§

impl<I0, I1> SystemInput for (I0, I1)
where I0: SystemInput, I1: SystemInput,

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1) as SystemInput>::Inner<'_>, ) -> <(I0, I1) as SystemInput>::Param<'_>

§

impl<I0, I1, I2> SystemInput for (I0, I1, I2)
where I0: SystemInput, I1: SystemInput, I2: SystemInput,

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2) as SystemInput>::Param<'_>

§

impl<I0, I1, I2, I3> SystemInput for (I0, I1, I2, I3)

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>, <I3 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>, <I3 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2, I3) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2, I3) as SystemInput>::Param<'_>

§

impl<I0, I1, I2, I3, I4> SystemInput for (I0, I1, I2, I3, I4)

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>, <I3 as SystemInput>::Param<'i>, <I4 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>, <I3 as SystemInput>::Inner<'i>, <I4 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2, I3, I4) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2, I3, I4) as SystemInput>::Param<'_>

§

impl<I0, I1, I2, I3, I4, I5> SystemInput for (I0, I1, I2, I3, I4, I5)

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>, <I3 as SystemInput>::Param<'i>, <I4 as SystemInput>::Param<'i>, <I5 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>, <I3 as SystemInput>::Inner<'i>, <I4 as SystemInput>::Inner<'i>, <I5 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2, I3, I4, I5) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2, I3, I4, I5) as SystemInput>::Param<'_>

§

impl<I0, I1, I2, I3, I4, I5, I6> SystemInput for (I0, I1, I2, I3, I4, I5, I6)

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>, <I3 as SystemInput>::Param<'i>, <I4 as SystemInput>::Param<'i>, <I5 as SystemInput>::Param<'i>, <I6 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>, <I3 as SystemInput>::Inner<'i>, <I4 as SystemInput>::Inner<'i>, <I5 as SystemInput>::Inner<'i>, <I6 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2, I3, I4, I5, I6) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2, I3, I4, I5, I6) as SystemInput>::Param<'_>

§

impl<I0, I1, I2, I3, I4, I5, I6, I7> SystemInput for (I0, I1, I2, I3, I4, I5, I6, I7)

§

type Param<'i> = (<I0 as SystemInput>::Param<'i>, <I1 as SystemInput>::Param<'i>, <I2 as SystemInput>::Param<'i>, <I3 as SystemInput>::Param<'i>, <I4 as SystemInput>::Param<'i>, <I5 as SystemInput>::Param<'i>, <I6 as SystemInput>::Param<'i>, <I7 as SystemInput>::Param<'i>)

§

type Inner<'i> = (<I0 as SystemInput>::Inner<'i>, <I1 as SystemInput>::Inner<'i>, <I2 as SystemInput>::Inner<'i>, <I3 as SystemInput>::Inner<'i>, <I4 as SystemInput>::Inner<'i>, <I5 as SystemInput>::Inner<'i>, <I6 as SystemInput>::Inner<'i>, <I7 as SystemInput>::Inner<'i>)

§

fn wrap( this: <(I0, I1, I2, I3, I4, I5, I6, I7) as SystemInput>::Inner<'_>, ) -> <(I0, I1, I2, I3, I4, I5, I6, I7) as SystemInput>::Param<'_>

§

impl<I> SystemInput for Option<I>
where I: SystemInput,

§

type Param<'i> = Option<<I as SystemInput>::Param<'i>>

§

type Inner<'i> = Option<<I as SystemInput>::Inner<'i>>

§

fn wrap( this: <Option<I> as SystemInput>::Inner<'_>, ) -> <Option<I> as SystemInput>::Param<'_>

§

impl<I> SystemInput for (I,)
where I: SystemInput,

§

type Param<'i> = (<I as SystemInput>::Param<'i>,)

§

type Inner<'i> = (<I as SystemInput>::Inner<'i>,)

§

fn wrap( this: <(I,) as SystemInput>::Inner<'_>, ) -> <(I,) as SystemInput>::Param<'_>

Implementors§

§

impl<'a, I> SystemInput for StaticSystemInput<'a, I>
where I: SystemInput,

§

type Param<'i> = StaticSystemInput<'i, I>

§

type Inner<'i> = <I as SystemInput>::Inner<'i>

§

impl<E, B> SystemInput for On<'_, '_, E, B>
where E: Event, B: Bundle,

Used for ObserverSystems.

§

type Param<'i> = On<'i, 'i, E, B>

§

type Inner<'i> = On<'i, 'i, E, B>

§

impl<T> SystemInput for In<T>
where T: 'static,

§

type Param<'i> = In<T>

§

type Inner<'i> = T

§

impl<T> SystemInput for InMut<'_, T>
where T: 'static + ?Sized,

§

type Param<'i> = InMut<'i, T>

§

type Inner<'i> = &'i mut T

§

impl<T> SystemInput for InRef<'_, T>
where T: 'static + ?Sized,

§

type Param<'i> = InRef<'i, T>

§

type Inner<'i> = &'i T