feat: implement CmdProxyState for managing proxy refresh state and add state management module

refactor: remove unnecessary macOS conditional compilation directive
This commit is contained in:
Tunglies
2025-06-05 13:43:02 +08:00
parent 7c738483b7
commit fee6a586d7
6 changed files with 49 additions and 47 deletions

View File

@@ -0,0 +1,4 @@
// Tauri Manager 会进行 Arc 管理,无需额外 Arc
// https://tauri.app/develop/state-management/#do-you-need-arc
pub mod proxy;

View File

@@ -0,0 +1,15 @@
pub struct CmdProxyState {
pub last_refresh_time: std::time::Instant,
pub need_refresh: bool,
pub providers_proxies: serde_json::Value,
}
impl Default for CmdProxyState {
fn default() -> Self {
Self {
last_refresh_time: std::time::Instant::now(),
need_refresh: true,
providers_proxies: serde_json::Value::Null,
}
}
}