Struct hydroflow::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§fn eq(&self, other: &StateHandleErased) -> bool
fn eq(&self, other: &StateHandleErased) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for StateHandleErased
impl PartialOrd for StateHandleErased
source§fn partial_cmp(&self, other: &StateHandleErased) -> Option<Ordering>
fn partial_cmp(&self, other: &StateHandleErased) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> TryFrom<StateHandleErased> for StateHandle<T>where
T: Any,
impl<T> TryFrom<StateHandleErased> for StateHandle<T>where
T: Any,
See StateHandleErased
.
§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