Skip to main content

ProgressCallback

Type Alias ProgressCallback 

Source
pub type ProgressCallback = dyn Fn(u64, u64) + Send + Sync;
Expand description

Delivery-progress callback: invoked with (received, expected) after each verified leaf lands, so a caller (e.g. decdn fetch) can render a progress bar. Both slots are content bytes: received is the content position the verifying decoder has reached and expected is the blob’s content total_bytes, constant across the pull — so a bar keyed on the two fills to exactly 100%. drive / acquire (the resumable crate::driver path the CLI fetch and bundle pull use) additionally emit the already-present resume base (base_present) once before streaming begins; the test-util stream_fetch_tracked_with_progress wrapper reports the same unit from its in-memory decoder.

It must not panic (it runs inside the hot receive loop) and must be Send + Sync so the pull future stays spawnable.