pub trait BlobSource {
// Required method
fn get_range(
&self,
hash: &str,
start: u64,
max_len: Option<u64>,
) -> impl Future<Output = RangeOutcome> + Send;
}Expand description
The ranged blob transport. Abstracted so the resume loop and degrade ladder are
exercised by deterministic mocks; HttpBlobSource is the production impl.
Required Methods§
Sourcefn get_range(
&self,
hash: &str,
start: u64,
max_len: Option<u64>,
) -> impl Future<Output = RangeOutcome> + Send
fn get_range( &self, hash: &str, start: u64, max_len: Option<u64>, ) -> impl Future<Output = RangeOutcome> + Send
Fetch the blob hash from byte offset start (an HTTP Range request).
max_len caps how many bytes this one request asks for: Some(w) requests
the bounded window bytes={start}-{start+w-1} (the adverse-network posture’s
bounded transfer windows), and None requests the open-ended remainder
bytes={start}-. A source may return fewer bytes than requested — the loop
resumes from wherever it actually reached.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".