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
//! BitTorrent announce event types.
use Deserialize;
/// The type of event in a tracker announce request.
///
/// Announce events indicate the state change of a peer as defined in BEP 3.
/// The event parameter is optional in announce requests; if omitted, it
/// indicates a regular periodic update.
///
/// # Event Types
///
/// - **None (0)**: Regular update, sent periodically while active
/// - **Completed (1)**: Sent when download finishes (becomes a seeder)
/// - **Started (2)**: Sent when beginning to download a torrent
/// - **Stopped (3)**: Sent when removing the torrent from the client
///
/// # Protocol Behavior
///
/// - `Started`: First announce when beginning a download
/// - `Completed`: Sent exactly once when download completes (left=0 for first time)
/// - `Stopped`: Final announce when closing the torrent, removes peer from swarm
/// - `None`: Regular updates during active downloading/seeding
///
/// # Example
///
/// ```rust
/// use torrust_actix::tracker::enums::announce_event::AnnounceEvent;
///
/// let event = AnnounceEvent::Completed;
/// assert_eq!(event as i32, 1);
/// ```