torrust_tracker_primitives/
swarm_metadata.rs

1use derive_more::Constructor;
2
3/// Swarm statistics for one torrent.
4/// Swarm metadata dictionary in the scrape response.
5///
6/// See [BEP 48: Tracker Protocol Extension: Scrape](https://www.bittorrent.org/beps/bep_0048.html)
7#[derive(Copy, Clone, Debug, PartialEq, Default, Constructor)]
8pub struct SwarmMetadata {
9    /// (i.e `completed`): The number of peers that have ever completed downloading
10    pub downloaded: u32, //
11    /// (i.e `seeders`): The number of active peers that have completed downloading (seeders)
12    pub complete: u32, //seeders
13    /// (i.e `leechers`): The number of active peers that have not completed downloading (leechers)
14    pub incomplete: u32,
15}
16
17impl SwarmMetadata {
18    #[must_use]
19    pub fn zeroed() -> Self {
20        Self::default()
21    }
22}