pub struct Progress { /* private fields */ }Expand description
Status update about a task progress.
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn indeterminate() -> Progress
pub fn indeterminate() -> Progress
New indeterminate.
Sourcepub fn from_fct(factor: impl Into<Factor>) -> Progress
pub fn from_fct(factor: impl Into<Factor>) -> Progress
New with a factor of completion.
The factor must be in the 0..=1 range, with a rounding error of 0.001, values outside this range
are converted to indeterminate.
Sourcepub fn with_msg(self, msg: impl Into<Txt>) -> Progress
pub fn with_msg(self, msg: impl Into<Txt>) -> Progress
Set the display message about the task status update.
Sourcepub fn with_meta_mut(
self,
meta: impl FnOnce(StateMapMut<'_, Progress>),
) -> Progress
pub fn with_meta_mut( self, meta: impl FnOnce(StateMapMut<'_, Progress>), ) -> Progress
Set custom status metadata for writing.
Note that metadata is shared between all clones of self.
Sourcepub fn and_fct(self, factor: impl Into<Factor>) -> Progress
pub fn and_fct(self, factor: impl Into<Factor>) -> Progress
Combine the factor completed fct with another factor.
Sourcepub fn and_n_of(self, n: usize, total: usize) -> Progress
pub fn and_n_of(self, n: usize, total: usize) -> Progress
Combine the factor completed fct with another factor computed from n of total.
Sourcepub fn with_fct(self, factor: impl Into<Factor>) -> Progress
pub fn with_fct(self, factor: impl Into<Factor>) -> Progress
Replace the fct value with a new factor.
Sourcepub fn with_n_of(self, n: usize, total: usize) -> Progress
pub fn with_n_of(self, n: usize, total: usize) -> Progress
Replace the fct value with a new factor computed from n of total.
Sourcepub fn fct(&self) -> Factor
pub fn fct(&self) -> Factor
Factor completed.
Is -1.fct() for indeterminate, otherwise is a value in the 0..=1 range, 1.fct() indicates task completion.
Sourcepub fn is_indeterminate(&self) -> bool
pub fn is_indeterminate(&self) -> bool
Factor of completion cannot be known.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Task has completed.
Sourcepub fn with_meta<T>(
&self,
visitor: impl FnOnce(StateMapRef<'_, Progress>) -> T,
) -> T
pub fn with_meta<T>( &self, visitor: impl FnOnce(StateMapRef<'_, Progress>) -> T, ) -> T
Borrow the custom status metadata for reading.
Trait Implementations§
Source§impl From<FactorPercent> for Progress
impl From<FactorPercent> for Progress
Source§fn from(completed: FactorPercent) -> Progress
fn from(completed: FactorPercent) -> Progress
Source§impl IntoVar<FactorPercent> for Progress
impl IntoVar<FactorPercent> for Progress
fn into_var(self) -> Var<FactorPercent>
impl Eq for Progress
impl IntoValue<Factor> for Progress
impl IntoValue<FactorPercent> for Progress
impl IntoValue<Progress> for &'static str
impl IntoValue<f32> for Progress
Auto Trait Implementations§
impl Freeze for Progress
impl !RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl !UnwindSafe for Progress
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DataNoteValue for T
impl<T> DataNoteValue for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote 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>
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>
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