pub trait IntoSystem<In, Out, Marker>: Sized {
    type System: System<In = In, Out = Out>;

    // Required method
    fn into_system(this: Self) -> Self::System;

    // Provided method
    fn pipe<B, Final, MarkerB>(
        self,
        system: B
    ) -> PipeSystem<Self::System, B::System>
       where B: IntoSystem<Out, Final, MarkerB> { ... }
}
Expand description

Conversion trait to turn something into a System.

Use this to get a system from a function. Also note that every system implements this trait as well.

Examples

use bevy_ecs::prelude::*;

fn my_system_function(a_usize_local: Local<usize>) {}

let system = IntoSystem::into_system(my_system_function);

Required Associated Types§

source

type System: System<In = In, Out = Out>

The type of System that this instance converts into.

Required Methods§

source

fn into_system(this: Self) -> Self::System

Turns this value into its corresponding System.

Provided Methods§

source

fn pipe<B, Final, MarkerB>( self, system: B ) -> PipeSystem<Self::System, B::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.

Implementors§

source§

impl<Marker, F> IntoSystem<<F as ExclusiveSystemParamFunction<Marker>>::In, <F as ExclusiveSystemParamFunction<Marker>>::Out, (IsExclusiveFunctionSystem, Marker)> for Fwhere Marker: 'static, F: ExclusiveSystemParamFunction<Marker>,

source§

impl<Marker, F> IntoSystem<<F as SystemParamFunction<Marker>>::In, <F as SystemParamFunction<Marker>>::Out, (IsFunctionSystem, Marker)> for Fwhere Marker: 'static, F: SystemParamFunction<Marker>,

§

type System = FunctionSystem<Marker, F>

source§

impl<T: System> IntoSystem<<T as System>::In, <T as System>::Out, ()> for T

§

type System = T