pub enum Resource<T> {
Loading,
Ready(T),
Error(String),
}
Expand description
The state of the resource.
Variants§
Implementations§
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Resource<T>
impl<T: PartialEq> PartialEq for Resource<T>
source§impl<T> Try for Resource<T>
impl<T> Try for Resource<T>
§type Output = T
type Output = T
🔬This is a nightly-only experimental API. (
try_trait_v2
)The type of the value produced by
?
when not short-circuiting.§type Residual = ResourceError
type Residual = ResourceError
🔬This is a nightly-only experimental API. (
try_trait_v2
)The type of the value passed to
FromResidual::from_residual
as part of ?
when short-circuiting. Read moresource§fn from_output(output: Self::Output) -> Self
fn from_output(output: Self::Output) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2
)Constructs the type from its
Output
type. Read moresource§fn branch(self) -> ControlFlow<ResourceError, Self::Output>
fn branch(self) -> ControlFlow<ResourceError, Self::Output>
🔬This is a nightly-only experimental API. (
try_trait_v2
)Used in
?
to decide whether the operator should produce a value
(because this returned ControlFlow::Continue
)
or propagate a value back to the caller
(because this returned ControlFlow::Break
). Read moreAuto Trait Implementations§
impl<T> Freeze for Resource<T>where
T: Freeze,
impl<T> RefUnwindSafe for Resource<T>where
T: RefUnwindSafe,
impl<T> Send for Resource<T>where
T: Send,
impl<T> Sync for Resource<T>where
T: Sync,
impl<T> Unpin for Resource<T>where
T: Unpin,
impl<T> UnwindSafe for Resource<T>where
T: 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