Struct zng_wgt_progress::Progress
source · 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
source§fn into_var(self) -> <Progress as IntoVar<FactorPercent>>::Var
fn into_var(self) -> <Progress as IntoVar<FactorPercent>>::Var
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<Progress> for &'static str
impl IntoVar<Progress> for &'static str
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 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
)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