Skip to main content

ProgressCallback

Trait ProgressCallback 

Source
pub trait ProgressCallback: Send + Sync {
    // Required method
    fn on_progress(&self, downloaded_bytes: u64, total_bytes: Option<u64>);
}
Expand description

Callback trait for receiving download progress updates.

Implement this on your own type to get notified as bytes are downloaded.

Required Methods§

Source

fn on_progress(&self, downloaded_bytes: u64, total_bytes: Option<u64>)

Called periodically during download.

  • downloaded_bytes - Total bytes downloaded so far.
  • total_bytes - Total file size if known by the server.

Implementors§