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
//! SWARM: many sources, one verified blob.
//!
//! A blob is named by the BLAKE3 hash of its bytes. This module is the pattern
//! that lets a caller fetch one from every holder at once and check each piece
//! against that name the moment it arrives, in any order. It owns no storage
//! and no discovery: the application keeps the pieces it is handed and decides
//! which peers to connect to (`docs/decisions/0040-swarm-pattern.md`).
//!
//! The piece tree is [`Blob`] (root, size and piece size of a blob),
//! [`PieceList`] (the piece hashes, checked against [`Blob::root`]),
//! [`TreeHasher`] (builds that list in one pass over the bytes) and [`Bits`]
//! (which pieces someone holds).
//!
//! The bound side is a [`crate::Seeder`]: it hands each fetch's session to
//! the application as a [`SeedSession`], whose orders the application answers
//! one at a time from its own storage. One exchange per (fetch, seeder) on the
//! request route a replier uses, so SWARM adds no frame to the protocol
//! (`docs/decisions/0041-swarm-sessions.md`). The dialling side is a
//! [`crate::Swarm`]: its [`Fetch`] keeps orders queued at every connected
//! seeder at once, as many as each seeder's rate needs, and yields each
//! [`Piece`] once it verifies against the root.
pub use ;
pub use ;
pub use ;
/// What a swarm asks a seeder about one [`Blob`].