Type Alias valence::ecs::system::lifetimeless::SRes

pub type SRes<T> = Res<'static, T>;
Expand description

A Res with 'static lifetimes.

Aliased Type§

struct SRes<T> { /* private fields */ }

Implementations

§

impl<'w, T> Res<'w, T>
where T: Resource,

pub fn clone(this: &Res<'w, T>) -> Res<'w, T>

Copies a reference to a resource.

Note that unless you actually need an instance of Res<T>, you should prefer to just convert it to &T which can be freely copied.

pub fn into_inner(self) -> &'w T

Due to lifetime limitations of the Deref trait, this method can be used to obtain a reference of the Resource with a lifetime bound to 'w instead of the lifetime of the struct itself.

Trait Implementations

§

impl<'w, T> AsRef<T> for Res<'w, T>
where T: Resource,

§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<'w, T> Debug for Res<'w, T>
where T: Resource + Debug + ?Sized,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'w, T> Deref for Res<'w, T>
where T: Resource + ?Sized,

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &<Res<'w, T> as Deref>::Target

Dereferences the value.
§

impl<'w, T> DetectChanges for Res<'w, T>
where T: Resource + ?Sized,

§

fn is_added(&self) -> bool

Returns true if this value was added after the system last ran.
§

fn is_changed(&self) -> bool

Returns true if this value was added or mutably dereferenced either since the last time the system ran or, if the system never ran, since the beginning of the program. Read more
§

fn last_changed(&self) -> Tick

Returns the change tick recording the time this data was most recently changed. Read more
§

impl<'w, T> From<ResMut<'w, T>> for Res<'w, T>
where T: Resource,

§

fn from(res: ResMut<'w, T>) -> Res<'w, T>

Converts to this type from the input type.
§

impl<'a, T> SystemParam for Res<'a, T>
where T: Resource,

§

type State = ComponentId

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

type Item<'w, 's> = Res<'w, T>

The item type returned when constructing this system param. The value of this associated type should be Self, instantiated with new lifetimes. Read more
§

fn init_state( world: &mut World, system_meta: &mut SystemMeta, ) -> <Res<'a, T> as SystemParam>::State

Registers any World access used by this SystemParam and creates a new instance of this param’s State.
§

unsafe fn get_param<'w, 's>( _: &'s mut <Res<'a, T> as SystemParam>::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick, ) -> <Res<'a, T> as SystemParam>::Item<'w, 's>

Creates a parameter to be passed into a SystemParamFunction. Read more
§

unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta, )

For the specified Archetype, registers the components accessed by this SystemParam (if applicable).a Read more
§

fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)

Applies any deferred mutations stored in this SystemParam’s state. This is used to apply Commands during apply_deferred.
§

fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )

Queues any deferred mutations to be applied at the next apply_deferred.
§

impl<'a, T> ReadOnlySystemParam for Res<'a, T>
where T: Resource,