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§
Sourcefn pause_capability(&self, supported: bool)
fn pause_capability(&self, supported: bool)
Observes whether the active interpreter can cooperatively pause retrieval.
Sourcefn progress(&self, destination: PathBuf, downloaded: u64, total: Option<u64>)
fn progress(&self, destination: PathBuf, downloaded: u64, total: Option<u64>)
Observes incremental byte progress toward one intended final path.
Sourcefn completed(&self, destination: PathBuf, bytes: u64)
fn completed(&self, destination: PathBuf, bytes: u64)
Observes terminal completion at a published path.
Sourcefn failed(&self, destination: PathBuf, message: String)
fn failed(&self, destination: PathBuf, message: String)
Observes terminal failure before publication completed.
Sourcefn program_failed(&self, summary: String, detail: String)
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".