diff --git a/src-tauri/src/config/mod.rs b/src-tauri/src/config/mod.rs new file mode 100644 index 0000000..27a78e3 --- /dev/null +++ b/src-tauri/src/config/mod.rs @@ -0,0 +1 @@ +pub mod verge; diff --git a/src-tauri/src/config/verge.rs b/src-tauri/src/config/verge.rs new file mode 100644 index 0000000..726bacb --- /dev/null +++ b/src-tauri/src/config/verge.rs @@ -0,0 +1,41 @@ +use serde::{Deserialize, Serialize}; + +/// Define the verge.yaml's schema +#[derive(Default, Debug, Clone, Deserialize, Serialize)] +pub struct VergeConfig { + /// current profile's name + pub current: Option, + + /// profile list + pub profiles: Option>, +} + +#[derive(Default, Debug, Clone, Deserialize, Serialize)] +pub struct ProfileData { + /// profile name + pub name: Option, + /// profile file + pub file: Option, + /// current mode + pub mode: Option, + /// source url + pub url: Option, + /// selected infomation + pub selected: Option>, + /// user info + pub user_info: Option, +} + +#[derive(Default, Debug, Clone, Deserialize, Serialize)] +pub struct ProfileSelected { + pub name: Option, + pub now: Option, +} + +#[derive(Default, Debug, Clone, Copy, Deserialize, Serialize)] +pub struct ProfileUserInfo { + pub upload: u64, + pub download: u64, + pub total: u64, + pub expire: u64, +}