Trait ProgressMonitor

Source
pub trait ProgressMonitor<W: Work>: Debug + Display {
    // Required methods
    fn worked<A: Into<W>>(&mut self, amount_of_work: A);
    fn total(&self) -> &W;
    fn completed(&self) -> &W;
    fn remaining(&self) -> Cow<'_, W>;
    fn close(&mut self) -> Result<(), CloseError>;
}
Expand description

A ProgressMonitor tracks an amount of work which must be completed.

Required Methods§

Source

fn worked<A: Into<W>>(&mut self, amount_of_work: A)

Source

fn total(&self) -> &W

Source

fn completed(&self) -> &W

Source

fn remaining(&self) -> Cow<'_, W>

Source

fn close(&mut self) -> Result<(), CloseError>

If you are done with your work, close this monitor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'n, 'p, W: Work, P: ProgressMonitor<W>> ProgressMonitor<W> for ChildMonitor<'n, 'p, W, P>

Source§

impl<'n, W, C> ProgressMonitor<W> for CallbackProgressMonitor<'n, W, C>
where W: Work, C: Fn(&W, &W),