forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.rs
More file actions
34 lines (31 loc) · 803 Bytes
/
request.rs
File metadata and controls
34 lines (31 loc) · 803 Bytes
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
use std::net::{IpAddr, SocketAddr};
use serde::{Deserialize};
use crate::InfoHash;
use crate::torrust_http_tracker::Bytes;
#[derive(Deserialize)]
pub struct AnnounceRequestQuery {
pub downloaded: Option<Bytes>,
pub uploaded: Option<Bytes>,
pub key: Option<String>,
pub peer_id: String,
pub port: u16,
pub left: Option<Bytes>,
pub event: Option<String>,
pub compact: Option<u8>,
}
#[derive(Debug)]
pub struct AnnounceRequest {
pub info_hash: InfoHash,
pub peer_addr: SocketAddr,
pub forwarded_ip: Option<IpAddr>,
pub downloaded: Bytes,
pub uploaded: Bytes,
pub peer_id: String,
pub port: u16,
pub left: Bytes,
pub event: Option<String>,
pub compact: Option<u8>,
}
pub struct ScrapeRequest {
pub info_hashes: Vec<InfoHash>,
}