Skip to main content

iroh_blobs/
lib.rs

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