syncthing_types/
lib.rs

1pub mod events;
2pub mod routes;
3pub mod system;
4#[cfg(feature = "utils")]
5pub mod utils;
6
7use serde::Deserialize;
8use std::collections::HashMap;
9
10//TODO: ip type for address, DeviceID/FolderID type with deser
11//FIXME: check folder == folderLable inconsistency
12
13type FileName = String;
14//TODO: use separate type?
15type DeviceID = String;
16type FolderName = String;
17type Folder = HashMap<FileName, File>;
18
19//TODO: maybe move to events if not used in system
20#[derive(Debug, Deserialize)]
21#[serde(rename_all(deserialize = "camelCase"))]
22pub struct File {
23    pub total: u64,
24    pub pulling: u64,
25    pub copied_from_origin: u64,
26    pub reused: u64,
27    pub copied_from_elsewhere: u64,
28    pub pulled: u64,
29    pub bytes_total: u64,
30    pub bytes_done: u64,
31}