Skip to main content

BundleObserver

Trait BundleObserver 

Source
pub trait BundleObserver: Send + Sync {
    // Provided methods
    fn run_started(
        &self,
        download_total: Option<u64>,
        content_total: Option<u64>,
    ) { ... }
    fn file_started(
        &self,
        paths: &[String],
        download_total: u64,
        reconstruct_total: u64,
    ) -> Arc<dyn FileObserver> ⓘ { ... }
    fn entry_landed(&self, landed: &EntryLanded) { ... }
    fn warning(&self, warning: &str) { ... }
    fn pool_replaced(&self, replaced: &PoolReplaced) { ... }
}
Expand description

Where a bundle pull reports its progress. Every method has a default that does nothing. The pull calls them from the task that awaits it.

Provided Methods§

Source

fn run_started(&self, download_total: Option<u64>, content_total: Option<u64>)

The pull starts on the entries it was given. download_total is the content bytes it plans to pay for, after shared chunks and duplicate files count once; content_total is the bytes that land on disk. Either is None when no entry declares a size.

Source

fn file_started( &self, paths: &[String], download_total: u64, reconstruct_total: u64, ) -> Arc<dyn FileObserver> ⓘ

One blob starts: it lands at every one of paths. download_total is the bytes it plans to pay for, and reconstruct_total the bytes it plans to splice from disk. The returned observer follows that blob.

Source

fn entry_landed(&self, landed: &EntryLanded)

One blob landed in its staging file.

Source

fn warning(&self, warning: &str)

Something went wrong that does not fail the pull, such as a manifest cache file that cannot be read or written.

Source

fn pool_replaced(&self, replaced: &PoolReplaced)

A funding recovery step replaced the pool. The pull runs the remaining entries once more against the new pool.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§