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
61
62
63
64
65
66
67
68
69
70
71
//! Announce request query parameters.
use IpAddr;
use Deserialize;
use crateAnnounceEvent;
use crateInfoHash;
use cratePeerId;
/// Parsed announce request parameters.
///
/// This struct represents the query parameters from a BitTorrent tracker
/// announce request. These parameters are defined in BEP 3 (The BitTorrent
/// Protocol Specification).
///
/// # Required Parameters (BEP 3)
///
/// - `info_hash`: 20-byte SHA-1 hash of the torrent info dictionary
/// - `peer_id`: 20-byte unique identifier for the client
/// - `port`: Port number the client is listening on
/// - `uploaded`: Total bytes uploaded since the "started" event
/// - `downloaded`: Total bytes downloaded since the "started" event
/// - `left`: Bytes remaining to download (0 = complete)
///
/// # Optional Parameters
///
/// - `compact`: If true, return peers in compact binary format (BEP 23)
/// - `no_peer_id`: If true, omit peer IDs from response
/// - `event`: One of "started", "completed", "stopped", or empty
/// - `numwant`: Number of peers the client wants (default: 50)
///
/// # Example Request
///
/// ```text
/// GET /announce?info_hash=%xx...&peer_id=%xx...&port=6881&uploaded=0&downloaded=0&left=1000000
/// ```