iroh_blobs/lib.rs
1#![doc = include_str!("../README.md")]
2//! # Module docs
3//!
4//! The crate is designed to be used from the [iroh] crate.
5//!
6//! It implements a [protocol] for streaming content-addressed data transfer using
7//! [BLAKE3] verified streaming.
8//!
9//! It also provides a [store] module for storage of blobs and outboards,
10//! as well as a [persistent](crate::store::fs) and a [memory](crate::store::mem)
11//! store implementation.
12//!
13//! To implement a server, the [provider] module provides helpers for handling
14//! connections and individual requests given a store.
15//!
16//! To perform get requests, the [get] module provides utilities to perform
17//! requests and store the result in a store, as well as a low level state
18//! machine for executing requests.
19//!
20//! The client API is available in the [api] module. You can get a client
21//! either from one of the [store] implementations, or from the [BlobsProtocol]
22//! via a
23//!
24//! The [downloader](api::downloader) module provides a component to download blobs from
25//! multiple sources and store them in a store.
26//!
27//! # Features:
28//!
29//! - `fs-store`: Enables the filesystem based store implementation. This comes with a few additional dependencies such as `redb` and `reflink-copy`.
30//! - `metrics`: Enables prometheus metrics for stores and the protocol.
31//!
32//! [BLAKE3]: https://github.com/BLAKE3-team/BLAKE3-specs/blob/master/blake3.pdf
33//! [iroh]: https://docs.rs/iroh
34mod hash;
35pub mod store;
36pub use hash::{BlobFormat, Hash, HashAndFormat};
37pub mod api;
38
39pub mod format;
40pub mod get;
41pub mod hashseq;
42mod metrics;
43mod net_protocol;
44pub use net_protocol::BlobsProtocol;
45pub mod protocol;
46pub mod provider;
47pub mod ticket;
48
49#[doc(hidden)]
50pub mod test;
51pub mod util;
52
53#[cfg(test)]
54#[cfg(feature = "fs-store")]
55mod tests;
56
57pub use protocol::ALPN;