pub trait Report: Send + Sync {
// Required method
fn advance(&self, completed: u64);
// Provided method
fn may_report(&self) -> bool { ... }
}Expand description
A sink for completed units of work.
advance only counts. It never blocks, polls, or reads a clock, so it is
safe in hot loops and on any thread; a phase shared by workers receives
reports from all of them. Report the actual number of finished units,
including a short final batch.
Required Methods§
Provided Methods§
Sourcefn may_report(&self) -> bool
fn may_report(&self) -> bool
Whether reports have any effect.
Only sinks that permanently discard reports return false. A caller
may skip work that exists only to compute a count.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".