pub struct MultiMut<'a> { /* private fields */ }
Expand description
Provides mutable access to multiple different component storages from a single world.
Implementations
sourceimpl<'a> MultiMut<'a>
impl<'a> MultiMut<'a>
sourcepub unsafe fn claim<T: Component>(&mut self) -> Option<&'a mut T::Storage>
pub unsafe fn claim<T: Component>(&mut self) -> Option<&'a mut T::Storage>
Claims exclusive access to a component storage.
Safety
The caller must ensure that each component type is only claimed once, as doing otherwise may result in mutable aliases of the component storage. This is validated in debug builds.
sourcepub unsafe fn claim_unknown(
&mut self,
type_id: ComponentTypeId
) -> Option<&'a mut dyn UnknownComponentStorage>
pub unsafe fn claim_unknown(
&mut self,
type_id: ComponentTypeId
) -> Option<&'a mut dyn UnknownComponentStorage>
Claims exclusive access to a component storage.
Safety
The caller must ensure that each component type is only claimed once, as doing otherwise may result in mutable aliases of the component storage. This is validated in debug builds.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for MultiMut<'a>
impl<'a> Send for MultiMut<'a>
impl<'a> Sync for MultiMut<'a>
impl<'a> Unpin for MultiMut<'a>
impl<'a> !UnwindSafe for MultiMut<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcepub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcepub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcepub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more