pub enum TaskState<T, E = String> {
Idle,
Loading {
progress: Option<f32>,
previous: Option<T>,
},
Ready(T),
Failed(E),
}Expand description
Lifecycle of a background operation observed through a Task.
Variants§
Idle
Loading
Running. progress is None while indeterminate, otherwise in 0..=1.
previous holds the last result while a Task::refresh runs.
Ready(T)
Failed(E)
Implementations§
Trait Implementations§
Source§impl<T, E> Observable<TaskState<T, E>> for Task<T, E>
impl<T, E> Observable<TaskState<T, E>> for Task<T, E>
fn source_id(&self) -> SourceId
fn source_name(&self) -> Arc<str> ⓘ
fn get(&self) -> TaskState<T, E>
Source§fn read(&self, reader: &mut dyn FnMut(&TaskState<T, E>))
fn read(&self, reader: &mut dyn FnMut(&TaskState<T, E>))
Call
reader once with a borrow of the current value. Read moreSource§fn value_version(&self) -> Option<u64>
fn value_version(&self) -> Option<u64>
A counter identifying the current value, or
None if unknown. Read morefn subscribe(&self, observer: Observer) -> Subscription
impl<T, E> StructuralPartialEq for TaskState<T, E>
Auto Trait Implementations§
impl<T, E> Forget for TaskState<T, E>
impl<T, E> Freeze for TaskState<T, E>
impl<T, E> Move for TaskState<T, E>
impl<T, E> RefUnwindSafe for TaskState<T, E>
impl<T, E> Send for TaskState<T, E>
impl<T, E> Sync for TaskState<T, E>
impl<T, E> Unpin for TaskState<T, E>
impl<T, E> UnsafeUnpin for TaskState<T, E>
impl<T, E> UnwindSafe for TaskState<T, E>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.