Struct ChildMonitor

Source
pub struct ChildMonitor<'n, 'p, W: Work, P: ProgressMonitor<W>> { /* private fields */ }
Expand description

A child monitor references a parent monitor. It monitors a subset of it’s parent’s total work, named parent_work. This monitors own scale is declared by sub_work and can be arbitrary. A child monitor, as a main monitor, tracks its progress. See sub_work_completed. Whenever work is being made in a child monitor, the parents progress is increased relative amount.

Example: Given a ChildMonitor with

  • parent_work == 10
  • sub_work == 1000 When a work(500) is submitted Then the parent.work(5) is submitted.

Implementations§

Source§

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

Source

pub fn new( name: Cow<'n, str>, parent: &'p mut P, parent_work: W, sub_work: W, ) -> Self

Source

pub fn name(&self) -> Cow<'n, str>

Trait Implementations§

Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

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

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.
Source§

impl<'p2, 'n2, 'p, 'n, N, W, A1, A2, P> ProgressMonitorDivision<'p, 'n, N, W, A1, A2> for ChildMonitor<'n2, 'p2, W, P>
where Self: ProgressMonitor<W> + Sized, N: Into<Cow<'n, str>>, W: Work, A1: Into<W>, A2: Into<W>, P: ProgressMonitor<W>,

Source§

fn new_child( &'p mut self, name: N, amount_of_parent_work: A1, amount_of_child_work: A2, ) -> ChildMonitor<'n, 'p, W, Self>

Auto Trait Implementations§

§

impl<'n, 'p, W, P> Freeze for ChildMonitor<'n, 'p, W, P>
where W: Freeze,

§

impl<'n, 'p, W, P> RefUnwindSafe for ChildMonitor<'n, 'p, W, P>

§

impl<'n, 'p, W, P> Send for ChildMonitor<'n, 'p, W, P>
where W: Send, P: Send,

§

impl<'n, 'p, W, P> Sync for ChildMonitor<'n, 'p, W, P>
where W: Sync, P: Sync,

§

impl<'n, 'p, W, P> Unpin for ChildMonitor<'n, 'p, W, P>
where W: Unpin,

§

impl<'n, 'p, W, P> !UnwindSafe for ChildMonitor<'n, 'p, W, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more