Skip to main content

FileObserver

Trait FileObserver 

Source
pub trait FileObserver: Send + Sync {
    // Provided methods
    fn delivered(&self, received: u64, expected: u64) { ... }
    fn discovering(&self) { ... }
    fn pending(&self) { ... }
    fn reconstructing(&self) { ... }
    fn hashed(&self, bytes: u64) { ... }
    fn finished(&self) { ... }
}
Expand description

Where one blob of a bundle pull reports its progress. Every method has a default that does nothing.

Provided Methods§

Source

fn delivered(&self, received: u64, expected: u64)

received of the blob’s expected content bytes are verified. Every fetch of the blob reports its whole position.

Source

fn discovering(&self)

The blob probes its holders before any byte arrives.

Source

fn pending(&self)

The blob’s own bytes are in, and it waits for a sibling to land the chunks it shares.

Source

fn reconstructing(&self)

The blob is assembled, and its whole-file hash runs.

Source

fn hashed(&self, bytes: u64)

The whole-file hash has read bytes bytes.

Source

fn finished(&self)

The blob’s pull settled, landed or failed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§