Skip to main content

ProgressTracker

Trait ProgressTracker 

Source
pub trait ProgressTracker:
    Send
    + Sync
    + Debug {
    // Required method
    fn increment(&self, table: Table, units: u64);

    // Provided methods
    fn register(&self, _table: Table, _total_units: u64) { ... }
    fn finish(&self) { ... }
}
Expand description

Receives generation-progress events for one PlanRunner invocation.

See the module-level documentation for the call-order contract. Trackers are passed to the runner as an std::sync::Arc and shared across concurrent generation tasks, so they must be Send + Sync. They must also be Debug so containing types can derive Debug.

Required Methods§

Source

fn increment(&self, table: Table, units: u64)

Advance the counter for table by units output units.

Called after generated output units are written. Multiple table-generation tasks may call this concurrently, so implementations should be lightweight and must never panic.

Provided Methods§

Source

fn register(&self, _table: Table, _total_units: u64)

Pre-register a table with its total expected output-unit count.

Called once per table before any worker starts. Implementations that need to know totals up front (e.g. to render a progress bar or compute an ETA) should override this; the default does nothing.

Source

fn finish(&self)

Called once after the last Self::increment on the success path. Implementations should use this for normal success cleanup and Drop only as an error or panic fallback. The default does nothing.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§