pub enum Loadable<T> {
NotAsked,
Loading,
Loaded(T, Instant),
Failed(String),
}Variants§
Implementations§
Source§impl<T> Loadable<T>
impl<T> Loadable<T>
pub fn value(&self) -> Option<&T>
Sourcepub fn value_mut(&mut self) -> Option<&mut T>
pub fn value_mut(&mut self) -> Option<&mut T>
Mutable access to loaded data, for a list that grows a page at a time rather than being replaced wholesale.
pub fn is_loading(&self) -> bool
pub fn error(&self) -> Option<&str>
pub fn loaded(value: T) -> Self
Sourcepub fn begin_refresh(&mut self)
pub fn begin_refresh(&mut self)
Mark as loading while keeping any value already on screen, so a refresh does not blank the view.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Loadable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Loadable<T>where
T: RefUnwindSafe,
impl<T> Send for Loadable<T>where
T: Send,
impl<T> Sync for Loadable<T>where
T: Sync,
impl<T> Unpin for Loadable<T>where
T: Unpin,
impl<T> UnsafeUnpin for Loadable<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Loadable<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