pub trait ExclusiveSystemParam: Sized {
type State: Send + Sync + 'static;
type Item<'s>: ExclusiveSystemParam<State = Self::State>;
// Required methods
fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self::State;
fn get_param<'s>(
state: &'s mut Self::State,
system_meta: &SystemMeta,
) -> Self::Item<'s>;
}
Expand description
A parameter that can be used in an exclusive system (a system with an &mut World
parameter).
Any parameters implementing this trait must come after the &mut World
parameter.
Required Associated Types§
Sourcetype State: Send + Sync + 'static
type State: Send + Sync + 'static
Used to store data which persists across invocations of a system.
Sourcetype Item<'s>: ExclusiveSystemParam<State = Self::State>
type Item<'s>: ExclusiveSystemParam<State = Self::State>
The item type returned when constructing this system param.
See SystemParam::Item
.
Required Methods§
Sourcefn init(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
Creates a new instance of this param’s State
.
Sourcefn get_param<'s>(
state: &'s mut Self::State,
system_meta: &SystemMeta,
) -> Self::Item<'s>
fn get_param<'s>( state: &'s mut Self::State, system_meta: &SystemMeta, ) -> Self::Item<'s>
Creates a parameter to be passed into an ExclusiveSystemParamFunction
.
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.