Skip to main content

ProgressReporter

Trait ProgressReporter 

Source
pub trait ProgressReporter: Send + Sync {
    // Provided method
    fn report(&self, event: HarvestEvent<'_>) { ... }
}
Expand description

Trait for reporting harvest progress.

Implementors can provide CLI output, server event streams, metrics, or any other form of progress reporting.

The default implementation does nothing (silent mode), which is appropriate for library usage where the caller doesn’t need progress updates.

§Example

use ceres_core::progress::{ProgressReporter, HarvestEvent};

struct MyReporter;

impl ProgressReporter for MyReporter {
    fn report(&self, event: HarvestEvent<'_>) {
        match event {
            HarvestEvent::PortalStarted { portal_name, .. } => {
                println!("Starting: {}", portal_name);
            }
            _ => {}
        }
    }
}

Provided Methods§

Source

fn report(&self, event: HarvestEvent<'_>)

Called when a harvest event occurs.

The default implementation does nothing (silent mode).

Implementors§