pub struct ResMut<'w, T: Resource> { /* private fields */ }Expand description
Mutable reference to a resource in World.
Analogous to Bevy’s ResMut<T>.
Appears in handler function signatures to declare a write dependency. Derefs to the inner value transparently.
For shared read access, use Res<T>. For optional write access
(no panic if unregistered), use Option<ResMut<T>>.
Construction is pub(crate) — only the dispatch layer creates these.
Trait Implementations§
Source§impl<T: Resource> Param for ResMut<'_, T>
impl<T: Resource> Param for ResMut<'_, T>
Source§type State = ResourceId
type State = ResourceId
Opaque state cached at build time (e.g.
ResourceId). Read moreSource§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 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>where
T: RefUnwindSafe,
impl<'w, T> Send for ResMut<'w, T>
impl<'w, T> Sync for ResMut<'w, T>where
T: Sync,
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