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>
impl<S: Clone + PartialEq> ProgressReport<S>
Sourcepub fn new(sender: Sender<Option<Progress<S>>>, clock: ClockRef) -> Self
pub fn new(sender: Sender<Option<Progress<S>>>, clock: ClockRef) -> Self
Report into sender, pacing reports by clock.
Sourcepub fn of(channel: &ProgressChannel<S>, clock: ClockRef) -> Self
pub fn of(channel: &ProgressChannel<S>, clock: ClockRef) -> Self
Report one run of the operation channel carries, pacing reports
by clock.
Sourcepub fn unwatched(clock: ClockRef) -> Self
pub fn unwatched(clock: ClockRef) -> Self
Report into a watch nobody holds, for work that runs the same steps where no host draws them.
Sourcepub fn begin(&mut self, step: S, total: u64)
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.
Sourcepub fn restart(&mut self)
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.
Sourcepub fn grow(&mut self, total: u64)
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.
Sourcepub fn relay(&mut self, progress: Progress<S>)
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.