Skip to main content

Reporter

Trait Reporter 

Source
pub trait Reporter: Send + Sync {
    // Required method
    fn report(&self, event: &Event) -> Result<(), ReporterError>;

    // Provided method
    fn is_enabled(&self) -> bool { ... }
}
Expand description

Consumes complete immutable progress events.

Required Methods§

Source

fn report(&self, event: &Event) -> Result<(), ReporterError>

Delivers one complete event.

Returns ReporterError without discarding the sink’s error source.

Provided Methods§

Source

fn is_enabled(&self) -> bool

Returns whether a new operation should emit events.

crate::ProgressBuilder::start samples this once per operation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Reporter for NoopReporter

Source§

impl<F> Reporter for F
where F: Fn(&Event) -> Result<(), ReporterError> + Send + Sync,

Source§

impl<W> Reporter for TextReporter<W>
where W: Write + Send,