Trait bevy::prelude::IntoSystem
pub trait IntoSystem<In, Out, Marker>: Sized {
type System: System<In = In, Out = Out>;
// Required method
fn into_system(this: Self) -> Self::System;
// Provided methods
fn pipe<B, Final, MarkerB>(
self,
system: B
) -> CombinatorSystem<Pipe, Self::System, <B as IntoSystem<Out, Final, MarkerB>>::System>
where B: IntoSystem<Out, Final, MarkerB> { ... }
fn map<T, F>(self, f: F) -> AdapterSystem<F, Self::System>
where F: Send + Sync + 'static + FnMut(Out) -> T { ... }
}
Expand description
Required Associated Types§
Required Methods§
fn into_system(this: Self) -> Self::System
fn into_system(this: Self) -> Self::System
Turns this value into its corresponding System
.
Provided Methods§
fn pipe<B, Final, MarkerB>(
self,
system: B
) -> CombinatorSystem<Pipe, Self::System, <B as IntoSystem<Out, Final, MarkerB>>::System>where
B: IntoSystem<Out, Final, MarkerB>,
fn pipe<B, Final, MarkerB>( self, system: B ) -> CombinatorSystem<Pipe, Self::System, <B as IntoSystem<Out, Final, MarkerB>>::System>where B: IntoSystem<Out, Final, MarkerB>,
Pass the output of this system A
into a second system B
, creating a new compound system.
The second system must have In<T>
as its first parameter,
where T
is the return type of the first system.
fn map<T, F>(self, f: F) -> AdapterSystem<F, Self::System>where
F: Send + Sync + 'static + FnMut(Out) -> T,
fn map<T, F>(self, f: F) -> AdapterSystem<F, Self::System>where F: Send + Sync + 'static + FnMut(Out) -> T,
Pass the output of this system into the passed function f
, creating a new system that
outputs the value returned from the function.
// Ignores the output of a system that may fail.
schedule.add_systems(my_system.map(std::mem::drop));
fn my_system(res: Res<T>) -> Result<(), Err> {
// ...
}