pub struct AsyncValue<T, E = String> {
pub value: Option<T>,
pub status: AsyncStatus<E>,
}Expand description
A value and, separately, what is currently happening to it.
Splitting the two is what lets a failed refresh keep the last verified value on screen instead of replacing it with an error.
Fields§
§value: Option<T>§status: AsyncStatus<E>Implementations§
Trait Implementations§
Source§impl<T: Clone, E: Clone> Clone for AsyncValue<T, E>
impl<T: Clone, E: Clone> Clone for AsyncValue<T, E>
Source§fn clone(&self) -> AsyncValue<T, E>
fn clone(&self) -> AsyncValue<T, E>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Eq, E: Eq> Eq for AsyncValue<T, E>
impl<T: PartialEq, E: PartialEq> StructuralPartialEq for AsyncValue<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for AsyncValue<T, E>
impl<T, E> RefUnwindSafe for AsyncValue<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for AsyncValue<T, E>
impl<T, E> Sync for AsyncValue<T, E>
impl<T, E> Unpin for AsyncValue<T, E>
impl<T, E> UnsafeUnpin for AsyncValue<T, E>where
T: UnsafeUnpin,
E: UnsafeUnpin,
impl<T, E> UnwindSafe for AsyncValue<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> 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