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§
Sourcefn run_started(&self, download_total: Option<u64>, content_total: Option<u64>)
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.
Sourcefn file_started(
&self,
paths: &[String],
download_total: u64,
reconstruct_total: u64,
) -> Arc<dyn FileObserver> ⓘ
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.
Sourcefn entry_landed(&self, landed: &EntryLanded)
fn entry_landed(&self, landed: &EntryLanded)
One blob landed in its staging file.
Sourcefn warning(&self, warning: &str)
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.
Sourcefn pool_replaced(&self, replaced: &PoolReplaced)
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".