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
source§impl IntoVar<Progress> for FactorPercent
impl IntoVar<Progress> for 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 Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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