Trait bevy::ecs::system::IntoSystem
[−]pub trait IntoSystem<In, Out, Params> {
type System: System
where
<Self::System as System>::In == In,
<Self::System as System>::Out == Out;
fn into_system(this: Self) -> Self::System;
fn system(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::system::IntoSystem;
use bevy_ecs::system::Res;
fn my_system_function(an_usize_resource: Res<usize>) {}
let system = IntoSystem::system(my_system_function);
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
👎 Deprecated since 0.7.0:
.system()
is no longer needed, as methods which accept systems will convert functions into a system automatically
Turns this value into its corresponding System
.
Use of this method was formerly required whenever adding a system
to an App
.
or other cases where a system is required.
However, since #2398,
this is no longer required.
In future, this method will be removed.
One use of this method is to assert that a given function is a valid system.
For this case, use bevy_ecs::system::assert_is_system
instead.