torbox_core_rs/data/
general.rs1use chrono::{DateTime, FixedOffset};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct TorboxGeneralStats {
7 #[serde(default)]
8 pub total_downloads: Option<u64>,
9 #[serde(default)]
10 pub total_users: Option<u64>,
11 #[serde(default)]
12 pub total_bytes_downloaded: Option<u64>,
13 #[serde(default)]
14 pub total_bytes_uploaded: Option<u64>,
15 #[serde(default)]
16 pub active_torrents: Option<u64>,
17 #[serde(default)]
18 pub active_usenet_downloads: Option<u64>,
19 #[serde(default)]
20 pub active_web_downloads: Option<u64>,
21 #[serde(default)]
22 pub total_usenet_downloads: Option<u64>,
23 #[serde(default)]
24 pub total_torrent_downloads: Option<u64>,
25 #[serde(default)]
26 pub total_web_downloads: Option<u64>,
27 #[serde(default)]
28 pub total_servers: Option<u64>,
29}
30
31#[derive(Debug, Serialize, Deserialize)]
32#[cfg_attr(feature = "specta", derive(specta::Type))]
33pub struct ChangelogJsonVersion {
34 pub name: String,
35 pub html: String,
36 pub markdown: String,
37 pub link: String,
38 pub created_at: DateTime<FixedOffset>,
39 pub id: String,
40}
41
42#[derive(Debug, Serialize, Deserialize)]
43#[cfg_attr(feature = "specta", derive(specta::Type))]
44pub struct SpeedtestFile {
45 pub region: String,
46 pub name: String,
47 pub domain: String,
48 pub path: String,
49 pub url: String,
50 pub closest: bool,
51 pub coordinates: Coordinates,
52}
53
54#[derive(Debug, Serialize, Deserialize)]
55#[cfg_attr(feature = "specta", derive(specta::Type))]
56pub struct Coordinates {
57 pub lat: f32,
58 pub lng: f32,
59}