You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/servers/http/v1/responses/announce.rs
+44-33Lines changed: 44 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ use std::panic::Location;
7
7
8
8
use axum::http::StatusCode;
9
9
use axum::response::{IntoResponse,Response};
10
-
use serde::{self,Deserialize,Serialize};
11
10
use thiserror::Error;
12
11
use torrust_tracker_configuration::AnnouncePolicy;
13
12
use torrust_tracker_contrib_bencode::{ben_bytes, ben_int, ben_list, ben_map,BMutAccess,BencodeMut};
14
13
14
+
usecrate::core::torrent::SwarmStats;
15
15
usecrate::core::{self,AnnounceData};
16
16
usecrate::servers::http::v1::responses;
17
17
@@ -22,15 +22,19 @@ use crate::servers::http::v1::responses;
22
22
/// ```rust
23
23
/// use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
24
24
/// use torrust_tracker_configuration::AnnouncePolicy;
25
+
/// use torrust_tracker::core::torrent::SwarmStats;
25
26
/// use torrust_tracker::servers::http::v1::responses::announce::{Normal, NormalPeer};
26
27
///
27
28
/// let response = Normal {
28
29
/// policy: AnnouncePolicy {
29
30
/// interval: 111,
30
31
/// interval_min: 222,
31
32
/// },
32
-
/// complete: 333,
33
-
/// incomplete: 444,
33
+
/// stats: SwarmStats {
34
+
/// downloaded: 0,
35
+
/// complete: 333,
36
+
/// incomplete: 444,
37
+
/// },
34
38
/// peers: vec
62
66
/// for more information.
63
-
#[derive(Serialize,Deserialize,Debug,PartialEq)]
67
+
#[derive(Debug,PartialEq)]
64
68
pubstructNormal{
65
-
/// Announce policy
66
69
pubpolicy:AnnouncePolicy,
67
-
/// Number of peers with the entire file, i.e. seeders.
68
-
pubcomplete:u32,
69
-
/// Number of non-seeder peers, aka "leechers".
70
-
pubincomplete:u32,
71
-
/// A list of peers. The value is a list of dictionaries.
0 commit comments