1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! [`ServeStore`]: node-only extension of [`RangedStore`] for progressive
//! serve-while-filling (#1621).
//!
//! `ServeStore` extends `bao_range::RangedStore` but is defined here, in
//! `cache`, rather than in the `bao-range` leaf crate: its two methods speak
//! iroh-blobs / `futures_util::Stream` types directly (a live present-ranges
//! watch and a re-encoded wire-bao stream), and `bao-range` stays free of an
//! iroh-blobs dependency (ADR 038). The node serve-miss serve path
//! (`crates/node/src/handlers/client/serve_encoder.rs`) consumes it, observing
//! the store's present ranges as the blob fills; `ServeStore` is the typed seam
//! that keeps those iroh-blobs types out of `bao-range`.
use Bytes;
use ;
use Pin;
/// A live watch of which chunk ranges of a blob are present. The first item
/// is the current bitfield; further items arrive as the blob fills. Mirrors
/// `iroh_blobs::api::blobs::ObserveProgress::stream()` — NEVER
/// `await_completion`, which hangs on a partial blob.
pub type PresentRangeWatch =
;
/// A stream of wire-format bao chunks for a re-encoded byte range —
/// interleaved proof pairs and chunk-group data in tree order, **header-less**
/// (no 8-byte size prefix; the signed `StreamResponse.total_bytes` is the
/// authoritative size, ADR 038). Each item is fallible with the store's
/// [`RangedStoreError`].
pub type EncodeStream =
;
/// 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.