bevy_ecs::system

Trait ExclusiveSystemParam

Source
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§

Source

type State: Send + Sync + 'static

Used to store data which persists across invocations of a system.

Source

type Item<'s>: ExclusiveSystemParam<State = Self::State>

The item type returned when constructing this system param. See SystemParam::Item.

Required Methods§

Source

fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self::State

Creates a new instance of this param’s State.

Source

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.

Implementations on Foreign Types§

Source§

impl ExclusiveSystemParam for ()

Source§

type State = ()

Source§

type Item<'s> = ()

Source§

fn init(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State

Source§

fn get_param<'s>( state: &'s mut Self::State, system_meta: &SystemMeta, ) -> Self::Item<'s>

Source§

impl<P: ExclusiveSystemParam> ExclusiveSystemParam for (P₁, P₂, …, Pₙ)

This trait is implemented for tuples up to 17 items long.

Source§

type State = (<P as ExclusiveSystemParam>::State,)

Source§

type Item<'s> = (<P as ExclusiveSystemParam>::Item<'s>,)

Source§

fn init(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State

Source§

fn get_param<'s>( state: &'s mut Self::State, system_meta: &SystemMeta, ) -> Self::Item<'s>

Source§

impl<S: ?Sized> ExclusiveSystemParam for PhantomData<S>

Source§

type State = ()

Source§

type Item<'s> = PhantomData<S>

Source§

fn init(_world: &mut World, _system_meta: &mut SystemMeta) -> Self::State

Source§

fn get_param<'s>( _state: &'s mut Self::State, _system_meta: &SystemMeta, ) -> Self::Item<'s>

Implementors§

Source§

impl ExclusiveSystemParam for WorldId

Source§

impl ExclusiveSystemParam for SystemName<'_>

Source§

type State = Cow<'static, str>

Source§

type Item<'s> = SystemName<'s>

Source§

impl<'_s, T: FromWorld + Send + 'static> ExclusiveSystemParam for Local<'_s, T>

Source§

type State = SyncCell<T>

Source§

type Item<'s> = Local<'s, T>

Source§

impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> ExclusiveSystemParam for &'a mut QueryState<D, F>

Source§

type State = QueryState<D, F>

Source§

type Item<'s> = &'s mut QueryState<D, F>

Source§

impl<'a, P: SystemParam + 'static> ExclusiveSystemParam for &'a mut SystemState<P>

Source§

type State = SystemState<P>

Source§

type Item<'s> = &'s mut SystemState<P>