pub struct ResMut<'w, T: 'static> { /* private fields */ }Expand description
Mutable reference to a resource in World.
Appears in system function signatures to declare a write dependency.
Derefs to the inner value transparently. Stamps the resource’s
changed_at sequence on DerefMut — the act of writing is the
change signal.
Construction is pub(crate) — only the dispatch layer creates these.
Implementations§
Trait Implementations§
Source§impl<T: 'static> SystemParam for ResMut<'_, T>
impl<T: 'static> SystemParam for ResMut<'_, T>
Source§type State = ResourceId
type State = ResourceId
Opaque state cached at build time (e.g.
ResourceId).Source§fn init(registry: &Registry) -> ResourceId
fn init(registry: &Registry) -> ResourceId
Resolve state from the registry. Called once at build time. Read more
Source§unsafe fn fetch<'w>(
world: &'w World,
state: &'w mut ResourceId,
) -> ResMut<'w, T>
unsafe fn fetch<'w>( world: &'w World, state: &'w mut ResourceId, ) -> ResMut<'w, T>
Fetch the item using cached state. Read more
Source§fn any_changed(state: &ResourceId, world: &World) -> bool
fn any_changed(state: &ResourceId, world: &World) -> bool
Returns
true if any resource this param depends on was modified
during the current sequence. Read moreSource§fn resource_id(state: &ResourceId) -> Option<ResourceId>
fn resource_id(state: &ResourceId) -> Option<ResourceId>
The ResourceId this param accesses, if any. Read more
Auto Trait Implementations§
impl<'w, T> Freeze for ResMut<'w, T>
impl<'w, T> !RefUnwindSafe for ResMut<'w, T>
impl<'w, T> !Send for ResMut<'w, T>
impl<'w, T> !Sync for ResMut<'w, T>
impl<'w, T> Unpin for ResMut<'w, T>
impl<'w, T> UnsafeUnpin for ResMut<'w, T>
impl<'w, T> !UnwindSafe for ResMut<'w, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more