pub struct DynamicComponent<T> { /* private fields */ }Expand description
A handle to a component of type T returned from a dynamic query, obtained by
DynamicItem::take.
Implementations§
Source§impl<T> DynamicComponent<T>
impl<T> DynamicComponent<T>
Sourcepub fn borrow(&self) -> Ref<'_, T>
pub fn borrow(&self) -> Ref<'_, T>
Attempt to immutably borrow this component. Panicks if the dynamic query is already dropped.
Sourcepub fn borrow_mut(&mut self) -> RefMut<'_, T>
pub fn borrow_mut(&mut self) -> RefMut<'_, T>
Attempt to mutably borrow this component. Panicks if the dynamic query is already dropped, or if the query only borrowed this component immutably.
Sourcepub fn try_borrow_mut(&mut self) -> Option<RefMut<'_, T>>
pub fn try_borrow_mut(&mut self) -> Option<RefMut<'_, T>>
Attempt to mutably borrow this component, returning None if the query only borrowed this
component immutably. Panicks if the dynamic query is already dropped.
Trait Implementations§
impl<T: Send + Sync> Send for DynamicComponent<T>
impl<T: Send + Sync> Sync for DynamicComponent<T>
Auto Trait Implementations§
impl<T> Freeze for DynamicComponent<T>
impl<T> RefUnwindSafe for DynamicComponent<T>where
T: RefUnwindSafe,
impl<T> Unpin for DynamicComponent<T>where
T: Unpin,
impl<T> UnwindSafe for DynamicComponent<T>where
T: UnwindSafe,
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