Struct generational_box::GenerationalBox
source · pub struct GenerationalBox<T, S: 'static = UnsyncStorage> { /* private fields */ }Expand description
The core Copy state type. The generational box will be dropped when the Owner is dropped.
Implementations§
source§impl<T: 'static, S: Storage<T>> GenerationalBox<T, S>
impl<T: 'static, S: Storage<T>> GenerationalBox<T, S>
sourcepub fn id(&self) -> GenerationalBoxId
pub fn id(&self) -> GenerationalBoxId
Get the id of the generational box.
sourcepub fn try_read(&self) -> Result<S::Ref<T>, BorrowError>
pub fn try_read(&self) -> Result<S::Ref<T>, BorrowError>
Try to read the value. Returns None if the value is no longer valid.
sourcepub fn try_write(&self) -> Result<S::Mut<T>, BorrowMutError>
pub fn try_write(&self) -> Result<S::Mut<T>, BorrowMutError>
Try to write the value. Returns None if the value is no longer valid.
Trait Implementations§
source§impl<T, S> Clone for GenerationalBox<T, S>
impl<T, S> Clone for GenerationalBox<T, S>
source§impl<T: 'static, S: AnyStorage> Debug for GenerationalBox<T, S>
impl<T: 'static, S: AnyStorage> Debug for GenerationalBox<T, S>
impl<T, S: 'static> Copy for GenerationalBox<T, S>
Auto Trait Implementations§
impl<T, S = UnsyncStorage> !RefUnwindSafe for GenerationalBox<T, S>
impl<T, S> Send for GenerationalBox<T, S>
impl<T, S> Sync for GenerationalBox<T, S>
impl<T, S> Unpin for GenerationalBox<T, S>where
T: Unpin,
impl<T, S = UnsyncStorage> !UnwindSafe for GenerationalBox<T, S>
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