pub trait ProgressSink {
// Provided methods
fn start(&mut self, label: &str, total: Option<u64>) { ... }
fn inc(&mut self, units: u64) { ... }
fn set(&mut self, current: u64) { ... }
fn message(&mut self, msg: &str) { ... }
fn finish(&mut self) { ... }
}Expand description
A sink for progress updates emitted by a library operation.
Every method has a no-op default, so a sink implements only what it needs. The library calls these; it never decides whether output is a tty, what colour to use, or how often to redraw — that is the CLI’s responsibility.
Provided Methods§
Sourcefn start(&mut self, label: &str, total: Option<u64>)
fn start(&mut self, label: &str, total: Option<u64>)
Begin a new progress phase labelled label, optionally with a known
total count of units (e.g. objects). None means the total is unknown.
Sourcefn set(&mut self, current: u64)
fn set(&mut self, current: u64)
Set the absolute progress of the current phase to current units.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: ProgressSink + ?Sized> ProgressSink for &mut T
Forwarding impl so a &mut P can be threaded into sub-operations that also
take impl ProgressSink without re-borrowing gymnastics at every call site.
impl<T: ProgressSink + ?Sized> ProgressSink for &mut T
Forwarding impl so a &mut P can be threaded into sub-operations that also
take impl ProgressSink without re-borrowing gymnastics at every call site.