pub trait ServeStore: RangedStore {
// Required methods
fn observe(&self) -> RangedFuture<'_, PresentRangeWatch>;
fn encode_range(
&self,
byte_offset: u64,
byte_len: u64,
) -> RangedFuture<'_, EncodeStream>;
}Expand description
Node-only extension of RangedStore: progressive serve-while-filling
primitives over an already-open per-blob store.
observe watches which ranges are present as a partial blob fills;
encode_range re-encodes whatever is currently held in a byte span into
the cdn/client/v1 header-less interleaved wire bao (ADR 038), the same
wire shape RangedStore::read does not produce.
Required Methods§
Sourcefn observe(&self) -> RangedFuture<'_, PresentRangeWatch>
fn observe(&self) -> RangedFuture<'_, PresentRangeWatch>
Watch which chunk ranges are present, from now until the blob is complete.
Precondition: the blob must already be materialized (at least its
first chunk group admitted, so the store reports Partial). A blob the
store has never seen has no defined current bitfield to watch, so this
returns Err rather than an empty watch. A serve driver must therefore
open the watch AFTER the first admit lands (or tolerate a transient
Err and retry), not the instant it kicks off an upstream pull.
Sourcefn encode_range(
&self,
byte_offset: u64,
byte_len: u64,
) -> RangedFuture<'_, EncodeStream>
fn encode_range( &self, byte_offset: u64, byte_len: u64, ) -> RangedFuture<'_, EncodeStream>
Re-encode the currently-present bytes of
[byte_offset, byte_offset + byte_len) into header-less wire bao.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".