Trait IntoSystem

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

    // Required method
    fn into_system(this: Self) -> Self::System;
}
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>

Required Methods§

Source

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

Turns this value into its corresponding System.

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.

Implementors§

Source§

impl<In, Out, Param, Marker, F> IntoSystem<In, Out, (IsFunctionSystem, Param, Marker)> for F
where In: 'static, Out: 'static, Param: SystemParam + 'static, Marker: 'static, F: SystemParamFunction<In, Out, Param, Marker> + Send + Sync + 'static,

Source§

type System = FunctionSystem<In, Out, Param, Marker, F>

Source§

impl<In, Out, Sys> IntoSystem<In, Out, AlreadyWasSystem> for Sys
where Sys: System<In = In, Out = Out>,

Source§

type System = Sys

Source§

impl<Param, Marker, F> IntoSystem<(), (), (IsExclusiveFunctionSystem, Param, Marker)> for F
where Param: ExclusiveSystemParam + 'static, Marker: 'static, F: ExclusiveSystemParamFunction<Param, Marker> + Send + Sync + 'static,

Source§

type System = ExclusiveFunctionSystem<Param, Marker, F>