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,
impl<'w, T> Res<'w, T>where
T: Resource,
pub fn clone(this: &Res<'w, T>) -> Res<'w, T>
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
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> DetectChanges for Res<'w, T>
impl<'w, T> DetectChanges for Res<'w, T>
§fn is_changed(&self) -> bool
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
fn last_changed(&self) -> Tick
Returns the change tick recording the time this data was most recently changed. Read more
§impl<'a, T> SystemParam for Res<'a, T>where
T: Resource,
impl<'a, T> SystemParam for Res<'a, T>where
T: Resource,
§type State = ComponentId
type State = ComponentId
Used to store data which persists across invocations of a system.
§type Item<'w, 's> = Res<'w, T>
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
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>
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,
)
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)
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<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
Queues any deferred mutations to be applied at the next
apply_deferred
.