Skip to main content

TransferObservation

Trait TransferObservation 

Source
pub trait TransferObservation {
    // Required methods
    fn pause_capability(&self, supported: bool);
    fn started(&self);
    fn elapsed(&self, elapsed: Duration);
    fn progress(
        &self,
        destination: PathBuf,
        downloaded: u64,
        total: Option<u64>,
    );
    fn completed(&self, destination: PathBuf, bytes: u64);
    fn failed(&self, destination: PathBuf, message: String);
    fn program_failed(&self, summary: String, detail: String);
}
Expand description

Defines the first-order observation stream affecting one transfer.

A variant is a method: the reified stream is generated from this vocabulary rather than written out, so an interpreter states what an observation means and never restates the shape.

Required Methods§

Source

fn pause_capability(&self, supported: bool)

Observes whether the active interpreter can cooperatively pause retrieval.

Source

fn started(&self)

Denotes that an interpreter started extraction.

Source

fn elapsed(&self, elapsed: Duration)

Observes elapsed transfer time.

Source

fn progress(&self, destination: PathBuf, downloaded: u64, total: Option<u64>)

Observes incremental byte progress toward one intended final path.

Source

fn completed(&self, destination: PathBuf, bytes: u64)

Observes terminal completion at a published path.

Source

fn failed(&self, destination: PathBuf, message: String)

Observes terminal failure before publication completed.

Source

fn program_failed(&self, summary: String, detail: String)

Denotes failure outside the resource-download program.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§