Struct generational_box::Owner
source · pub struct Owner { /* private fields */ }
Expand description
Owner: Handles dropping generational boxes. The owner acts like a runtime lifetime guard. Any states that you create with an owner will be dropped when that owner is dropped.
Implementations§
source§impl Owner
impl Owner
sourcepub fn insert<T: 'static>(&self, value: T) -> GenerationalBox<T>
pub fn insert<T: 'static>(&self, value: T) -> GenerationalBox<T>
Insert a value into the store. The value will be dropped when the owner is dropped.
sourcepub fn invalid<T: 'static>(&self) -> GenerationalBox<T>
pub fn invalid<T: 'static>(&self) -> GenerationalBox<T>
Creates an invalid handle. This is useful for creating a handle that will be filled in later. If you use this before the value is filled in, you will get may get a panic or an out of date value.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Owner
impl !Send for Owner
impl !Sync for Owner
impl Unpin for Owner
impl !UnwindSafe for Owner
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