pub struct Progress { /* private fields */ }Expand description
Status update about a task progress.
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn indeterminate() -> Self
pub fn indeterminate() -> Self
New indeterminate.
Sourcepub fn from_fct(factor: impl Into<Factor>) -> Self
pub fn from_fct(factor: impl Into<Factor>) -> Self
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>) -> Self
pub fn with_msg(self, msg: impl Into<Txt>) -> Self
Set the display message about the task status update.
Sourcepub fn with_meta_mut(self, meta: impl FnOnce(StateMapMut<'_, Progress>)) -> Self
pub fn with_meta_mut(self, meta: impl FnOnce(StateMapMut<'_, Progress>)) -> Self
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>) -> Self
pub fn and_fct(self, factor: impl Into<Factor>) -> Self
Combine the factor completed fct with another factor.
Sourcepub fn and_n_of(self, n: usize, total: usize) -> Self
pub fn and_n_of(self, n: usize, total: usize) -> Self
Combine the factor completed fct with another factor computed from n of total.
Sourcepub fn with_fct(self, factor: impl Into<Factor>) -> Self
pub fn with_fct(self, factor: impl Into<Factor>) -> Self
Replace the fct value with a new factor.
Sourcepub fn with_n_of(self, n: usize, total: usize) -> Self
pub fn with_n_of(self, n: usize, total: usize) -> Self
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) -> Self
fn from(completed: FactorPercent) -> Self
Source§impl From<Progress> for FactorPercent
impl From<Progress> for FactorPercent
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<Progress> for (usize, usize)
impl IntoValue<Progress> for Factor
impl IntoValue<Progress> for FactorPercent
impl IntoValue<Progress> for Metrics
impl IntoValue<Progress> for Metrics
impl IntoValue<Progress> for Txt
impl IntoValue<Progress> for bool
impl IntoValue<Progress> for f32
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§
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,
§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
§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.§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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