pub enum Resource<T> {
Loading,
Ready(T),
Error(String),
}Expand description
The state of the resource.
Variants§
Implementations§
Source§impl<T> Resource<T>
impl<T> Resource<T>
Sourcepub fn into_result(self) -> Result<T, ResourceError>
pub fn into_result(self) -> Result<T, ResourceError>
Convert into a Result so that ? can be used inside functions
returning another Resource. Use resource.into_result()? instead
of the previously-required nightly Try impl.
Trait Implementations§
Auto 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> UnsafeUnpin for Resource<T>where
T: UnsafeUnpin,
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