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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Torrent entry with peer collections and metadata.
use cratePeerId;
use crateTorrentPeer;
use AHasher;
use Serialize;
use HashMap;
use BuildHasherDefault;
/// A high-performance HashMap using the aHash algorithm.
///
/// This type alias provides faster hashing compared to the standard HashMap
/// by using the aHash algorithm which is optimized for HashDoS resistance
/// and performance.
pub type AHashMap<K, V> = ;
/// A torrent entry containing peer lists and metadata.
///
/// Each `TorrentEntry` represents a tracked torrent and contains:
/// - Separate maps for seeds (complete) and peers (incomplete)
/// - Completion counter for the number of times the torrent was completed
/// - Last update timestamp for cleanup purposes
///
/// # Peer Storage
///
/// Peers are stored in high-performance hash maps keyed by their peer ID.
/// Seeds (clients with 100% of the torrent) and peers (clients still downloading)
/// are stored separately for efficient announce responses.
///
/// # Example
///
/// ```rust,ignore
/// use torrust_actix::tracker::structs::torrent_entry::TorrentEntry;
///
/// // Get peer counts
/// let seeds_count = entry.seeds.len();
/// let peers_count = entry.peers.len();
/// let completions = entry.completed;
/// ```