Enum MutationStateData
pub enum MutationStateData<Q>where
Q: MutationCapability,{
Pending,
Loading {
res: Option<Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>>,
},
Settled {
res: Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>,
settlement_instant: Instant,
},
}Available on crate feature
query only.Variants§
Pending
Has not loaded yet.
Loading
Is loading and may not have a previous settled value.
Fields
§
res: Option<Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>>Settled
Is not loading and has a settled value.
Fields
§
res: Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>Implementations§
§impl<Q> MutationStateData<Q>where
Q: MutationCapability,
impl<Q> MutationStateData<Q>where
Q: MutationCapability,
pub fn is_ok(&self) -> bool
pub fn is_ok(&self) -> bool
Check if the state is MutationStateData::Settled and Result::Ok.
pub fn is_err(&self) -> bool
pub fn is_err(&self) -> bool
Check if the state is MutationStateData::Settled and Result::Err.
pub fn is_loading(&self) -> bool
pub fn is_loading(&self) -> bool
Check if the state is MutationStateData::Loading.
pub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if the state is MutationStateData::Pending.
pub fn ok(&self) -> Option<&<Q as MutationCapability>::Ok>
pub fn ok(&self) -> Option<&<Q as MutationCapability>::Ok>
Get the value as an Option.
pub fn unwrap(
&self,
) -> &Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>
pub fn unwrap( &self, ) -> &Result<<Q as MutationCapability>::Ok, <Q as MutationCapability>::Err>
Get the value as an Result if possible, otherwise it will panic.
Trait Implementations§
§impl<Q> Debug for MutationStateData<Q>where
Q: MutationCapability,
<Q as MutationCapability>::Ok: Debug,
<Q as MutationCapability>::Err: Debug,
impl<Q> Debug for MutationStateData<Q>where
Q: MutationCapability,
<Q as MutationCapability>::Ok: Debug,
<Q as MutationCapability>::Err: Debug,
Auto Trait Implementations§
impl<Q> Freeze for MutationStateData<Q>
impl<Q> RefUnwindSafe for MutationStateData<Q>
impl<Q> Send for MutationStateData<Q>
impl<Q> Sync for MutationStateData<Q>
impl<Q> Unpin for MutationStateData<Q>
impl<Q> UnwindSafe for MutationStateData<Q>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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