syncthing_rs/types/
system.rs

1//! All types required for the system endpoints
2use std::collections::HashMap;
3
4use chrono::Utc;
5use serde::{Deserialize, Serialize};
6
7#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
8pub struct Connections {
9    pub connections: HashMap<String, Connection>,
10    pub total: TotalConnections,
11}
12
13#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
14#[serde(rename_all = "camelCase")]
15pub struct Connection {
16    pub address: String,
17    pub at: chrono::DateTime<Utc>,
18    pub client_version: String,
19    pub connected: bool,
20    pub in_bytes_total: i64,
21    pub is_local: bool,
22    pub out_bytes_total: i64,
23    pub paused: bool,
24    pub started_at: chrono::DateTime<Utc>,
25    #[serde(rename = "type")]
26    pub ty: String,
27}
28
29#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
30#[serde(rename_all = "camelCase")]
31pub struct TotalConnections {
32    pub at: chrono::DateTime<Utc>,
33    pub in_bytes_total: i64,
34    pub out_bytes_total: i64,
35}