Struct dfir_rs::scheduled::state::StateHandleErased
source · pub struct StateHandleErased { /* private fields */ }
Expand description
A state handle with the generic type parameter erased, allowing it to be stored in omogenous
data structures. The type is tracked internally as data via TypeId
.
Use StateHandleErased::from(state_handle)
to create an instance
from a typed StateHandle<T>
.
Use StateHandle::<T>::try_from()
to convert the StateHandleErased
back into a StateHandle<T>
of the given type T
. If T
is the wrong type then the original
StateHandleErased
will be returned as the Err
.
Trait Implementations§
source§impl Clone for StateHandleErased
impl Clone for StateHandleErased
source§fn clone(&self) -> StateHandleErased
fn clone(&self) -> StateHandleErased
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StateHandleErased
impl Debug for StateHandleErased
source§impl<T> From<StateHandle<T>> for StateHandleErasedwhere
T: Any,
impl<T> From<StateHandle<T>> for StateHandleErasedwhere
T: Any,
See StateHandleErased
.
source§fn from(value: StateHandle<T>) -> Self
fn from(value: StateHandle<T>) -> Self
Converts to this type from the input type.
source§impl Hash for StateHandleErased
impl Hash for StateHandleErased
source§impl Ord for StateHandleErased
impl Ord for StateHandleErased
source§fn cmp(&self, other: &StateHandleErased) -> Ordering
fn cmp(&self, other: &StateHandleErased) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for StateHandleErased
impl PartialEq for StateHandleErased
source§impl PartialOrd for StateHandleErased
impl PartialOrd for StateHandleErased
source§impl<T> TryFrom<StateHandleErased> for StateHandle<T>where
T: Any,
impl<T> TryFrom<StateHandleErased> for StateHandle<T>where
T: Any,
See StateHandleErased
.
source§type Error = StateHandleErased
type Error = StateHandleErased
The type returned in the event of a conversion error.
impl Copy for StateHandleErased
impl Eq for StateHandleErased
impl StructuralPartialEq for StateHandleErased
Auto Trait Implementations§
impl Freeze for StateHandleErased
impl RefUnwindSafe for StateHandleErased
impl Send for StateHandleErased
impl Sync for StateHandleErased
impl Unpin for StateHandleErased
impl UnwindSafe for StateHandleErased
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more