pub struct Owner<S = UnsyncStorage>(/* private fields */)
where
S: AnyStorage + 'static;
Available on crate feature
signals
only.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<S> Owner<S>where
S: AnyStorage,
impl<S> Owner<S>where
S: AnyStorage,
sourcepub fn insert<T>(&self, value: T) -> GenerationalBox<T, S>where
T: 'static,
S: Storage<T>,
pub fn insert<T>(&self, value: T) -> GenerationalBox<T, S>where
T: 'static,
S: Storage<T>,
Insert a value into the store. The value will be dropped when the owner is dropped.
sourcepub fn insert_with_caller<T>(
&self,
value: T,
caller: &'static Location<'static>
) -> GenerationalBox<T, S>where
T: 'static,
S: Storage<T>,
pub fn insert_with_caller<T>(
&self,
value: T,
caller: &'static Location<'static>
) -> GenerationalBox<T, S>where
T: 'static,
S: Storage<T>,
Insert a value into the store with a specific location blamed for creating the value. The value will be dropped when the owner is dropped.
sourcepub fn invalid<T>(&self) -> GenerationalBox<T, S>where
T: 'static,
pub fn invalid<T>(&self) -> GenerationalBox<T, S>where
T: 'static,
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§
source§impl<S> Clone for Owner<S>where
S: AnyStorage,
impl<S> Clone for Owner<S>where
S: AnyStorage,
Auto Trait Implementations§
impl<S> Freeze for Owner<S>where
S: Default,
impl<S = UnsyncStorage> !RefUnwindSafe for Owner<S>
impl<S> Send for Owner<S>
impl<S> Sync for Owner<S>
impl<S> Unpin for Owner<S>where
S: Default,
impl<S = UnsyncStorage> !UnwindSafe for Owner<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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
source§impl<Cfg> TryIntoConfig for Cfg
impl<Cfg> TryIntoConfig for Cfg
source§fn into_config(self) -> Option<Cfg>
fn into_config(self) -> Option<Cfg>
Available on crate feature
launch
only.