Skip to main content

Crate xlb

Crate xlb 

Source
Expand description

§xlb — chunked, Bao-verified blob distribution

Reads as peer-eXchange + LAN + Bao-tree. Mnemonic: each blob is a xiaolongbao — content sealed in a verified wrapper, served from a kitchen, shareable across tables.

Multi-source concurrent fetch (local cache → LAN peer → swarm peer → permanent seed → CDN edge), with per-chunk BLAKE3 Bao-tree verification so chunks pulled from different sources are independently verifiable.

Status: xlb-4. Core types + iroh-blobs transport (xlb-2) + HTTP CDN fallback + Bao verifier glue (xlb-3) + BandwidthGovernor with battery/metered auto-detection (xlb-4). Full five-tier fetch chain wired per .yah/docs/architecture/xlb.md.

Re-exports§

pub use bandwidth::BandwidthGovernor;
pub use metrics::FetchObserver;
pub use metrics::FetchReport;
pub use seed::derive_key;
pub use seed::seed_blob;
pub use seed::R2Target;
pub use seed::SeedOutcome;

Modules§

bandwidth
Bandwidth policy + auto-governors (xlb-4).
metrics
Per-fetch observability — which tier actually served a blob, from whom, how many bytes, and how long it took (R423-T7).
seed
xlb seed — publish content-addressed blobs to an S3-compatible origin.
testing
In-process mock swarm for testing the xlb fetch chain.
transport

Structs§

Asset
A handle to a specific content-addressed blob within an AssetClass.
AssetClass
A registered asset class — a per-app namespace for content-addressed blobs.
AssetClassConfig
Configuration for an AssetClass.
BandwidthPolicy
Per-class bandwidth policy: caps keyed by PeerTier.
BlakeHash
A BLAKE3 content-hash — the stable identity of an xlb asset.
BwCaps
Upload/download bandwidth caps for one tier.
CacheStats
A point-in-time reading of one class’s cache occupancy (R423-T6).
Discovery
Which discovery mechanisms to enable for an AssetClass.
FetchProgress
Cumulative download progress for a single in-flight fetch.

Enums§

Error
FetchTier
Position in the five-tier fetch-chain priority order.
PeerTier
Coarse label used by BandwidthPolicy to bucket peers.
SeedRole
The role this process plays for an AssetClass.

Type Aliases§

ProgressSink
Callback sink for incremental FetchProgress during a fetch.
Result