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:
(): No inputIn<T>: For valuesInRef<T>: For read-only references to valuesInMut<T>: For mutable references to valuesTrigger<E, B>: ForObserverSystemsStaticSystemInput<I>: For arbitrarySystemInputs in generic contexts- Tuples of
SystemInputs up to 8 elements
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§
Sourcetype Param<'i>: SystemInput
type Param<'i>: SystemInput
The wrapper input type that is defined as the first argument to FunctionSystems.
Sourcetype Inner<'i>
type Inner<'i>
The inner input type that is passed to functions that run systems,
such as System::run.
Required Methods§
Sourcefn wrap(this: Self::Inner<'_>) -> Self::Param<'_>
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_>
Converts a SystemInput::Inner into a SystemInput::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§
Source§impl SystemInput for ()
impl SystemInput for ()
Source§impl<I0, I1> SystemInput for (I0, I1)where
I0: SystemInput,
I1: SystemInput,
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<'_>
Source§impl<I0, I1, I2> SystemInput for (I0, I1, I2)
impl<I0, I1, I2> SystemInput for (I0, I1, I2)
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<'_>
Source§impl<I0, I1, I2, I3> SystemInput for (I0, I1, I2, I3)
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<'_>
Source§impl<I0, I1, I2, I3, I4> SystemInput for (I0, I1, I2, I3, I4)
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<'_>
Source§impl<I0, I1, I2, I3, I4, I5> SystemInput for (I0, I1, I2, I3, I4, I5)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
impl<I0, I1, I2, I3, I4, I5> SystemInput for (I0, I1, I2, I3, I4, I5)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
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<'_>
Source§impl<I0, I1, I2, I3, I4, I5, I6> SystemInput for (I0, I1, I2, I3, I4, I5, I6)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
I6: SystemInput,
impl<I0, I1, I2, I3, I4, I5, I6> SystemInput for (I0, I1, I2, I3, I4, I5, I6)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
I6: SystemInput,
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<'_>
Source§impl<I0, I1, I2, I3, I4, I5, I6, I7> SystemInput for (I0, I1, I2, I3, I4, I5, I6, I7)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
I6: SystemInput,
I7: SystemInput,
impl<I0, I1, I2, I3, I4, I5, I6, I7> SystemInput for (I0, I1, I2, I3, I4, I5, I6, I7)where
I0: SystemInput,
I1: SystemInput,
I2: SystemInput,
I3: SystemInput,
I4: SystemInput,
I5: SystemInput,
I6: SystemInput,
I7: SystemInput,
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<'_>
Source§impl<I> SystemInput for (I,)where
I: SystemInput,
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§
Source§impl<'a, I> SystemInput for StaticSystemInput<'a, I>where
I: SystemInput,
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>
Source§impl<E, B> SystemInput for Trigger<'_, E, B>where
E: 'static,
B: Bundle,
Used for ObserverSystems.
impl<E, B> SystemInput for Trigger<'_, E, B>where
E: 'static,
B: Bundle,
Used for ObserverSystems.