Skip to main content

Report

Trait Report 

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

Source

fn advance(&self, completed: u64)

Add completed finished units.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl<T: Report + ?Sized> Report for &T

Source§

fn advance(&self, completed: u64)

Source§

fn may_report(&self) -> bool

Source§

impl<T: Report + ?Sized> Report for &mut T

Source§

fn advance(&self, completed: u64)

Source§

fn may_report(&self) -> bool

Source§

impl<T: Report + ?Sized> Report for Arc<T>

Source§

fn advance(&self, completed: u64)

Source§

fn may_report(&self) -> bool

Source§

impl<T: Report + ?Sized> Report for Box<T>

Source§

fn advance(&self, completed: u64)

Source§

fn may_report(&self) -> bool

Source§

impl<T: Report> Report for Option<T>

None discards reports; Some forwards them.

Source§

fn advance(&self, completed: u64)

Source§

fn may_report(&self) -> bool

Implementors§