syncthing_types/system/
connections.rs

1use crate::DeviceID;
2use serde::Deserialize;
3use std::collections::HashMap;
4
5#[derive(Debug, Deserialize)]
6pub struct DeviceStats {
7    pub address: String,
8    pub at: String,
9    //TODO: enum
10    #[serde(rename = "clientVersion")]
11    pub client_version: String,
12    pub connected: bool,
13    pub crypto: String,
14    #[serde(rename = "inBytesTotal")]
15    pub in_bytes_total: u64,
16    #[serde(rename = "outBytesTotal")]
17    pub out_bytes_total: u64,
18    pub paused: bool,
19    #[serde(rename = "type")]
20    pub device_type: String,
21}
22
23#[derive(Debug, Deserialize)]
24pub struct Connections {
25    pub total: DeviceStats,
26    pub connections: HashMap<DeviceID, DeviceStats>,
27}