Skip to main content

ProgressReport

Struct ProgressReport 

Source
pub struct ProgressReport<S> { /* private fields */ }
Expand description

Reports one operation’s progress into a watch. A step’s beginning and its last unit are always reported; between them, a report waits until REPORT_INTERVAL has passed since the one before. Reporting stores the newest value and writes nothing to a database.

Implementations§

Source§

impl<S: Clone + PartialEq> ProgressReport<S>

Source

pub fn new(sender: Sender<Option<Progress<S>>>, clock: ClockRef) -> Self

Report into sender, pacing reports by clock.

Source

pub fn of(channel: &ProgressChannel<S>, clock: ClockRef) -> Self

Report one run of the operation channel carries, pacing reports by clock.

Source

pub fn unwatched(clock: ClockRef) -> Self

Report into a watch nobody holds, for work that runs the same steps where no host draws them.

Source

pub fn begin(&mut self, step: S, total: u64)

Begin step, with total units to do; reported at once. A step begins once, after the steps before it, unless the operation starts over.

Source

pub fn restart(&mut self)

The operation starts over from its first step, as when what it read went stale before it could use it. Its steps begin again.

Source

pub fn done(&mut self, done: u64)

done of the current step’s units are done.

Source

pub fn advance(&mut self)

One more of the current step’s units is done.

Source

pub fn grow(&mut self, total: u64)

The current step has total units in all: more than it counted as it began, since work it had no way to count turned up.

Source

pub fn relay(&mut self, progress: Progress<S>)

Report progress, which another operation’s report gave and the caller put in this operation’s steps, as the part of this operation that other one runs: a step it begins is reported at once, and within a step its units are paced as Self::done’s are.

Auto Trait Implementations§

§

impl<S> Freeze for ProgressReport<S>
where S: Freeze,

§

impl<S> !RefUnwindSafe for ProgressReport<S>

§

impl<S> Send for ProgressReport<S>
where S: Send + Sync,

§

impl<S> Sync for ProgressReport<S>
where S: Sync + Send,

§

impl<S> Unpin for ProgressReport<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for ProgressReport<S>
where S: UnsafeUnpin,

§

impl<S> !UnwindSafe for ProgressReport<S>

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.

§

impl<T> Instrument for T

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,