Skip to main content

Reporter

Trait Reporter 

Source
pub trait Reporter {
    // Provided methods
    fn fetch_start(&self, total: Option<u64>) { ... }
    fn fetch_inc(&self, n: u64) { ... }
    fn phase(&self, name: &str) { ... }
}
Expand description

Observes the progress of an Engine::install_artifact_reported run so a caller (the CLI) can render download bars and phase spinners without this crate depending on a UI crate. All methods have no-op defaults; the unit type () implements it as a fully silent reporter.

Provided Methods§

Source

fn fetch_start(&self, total: Option<u64>)

The fetch stage is about to begin; total is the artifact’s declared size in bytes when known (used as the download bar’s length).

Source

fn fetch_inc(&self, n: u64)

n more bytes have been downloaded.

Source

fn phase(&self, name: &str)

A new post-fetch phase has begun (e.g. "verifying", "extracting").

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Reporter for ()

Silent reporter: the default when no progress UI is wired in.

Implementors§