mod clash; mod prfitem; mod profiles; mod verge; pub use self::clash::*; pub use self::prfitem::*; pub use self::profiles::*; pub use self::verge::*; use once_cell::sync::OnceCell; use parking_lot::Mutex; use std::sync::Arc; #[derive(Debug, Clone)] pub struct Data { pub clash: Arc>, pub verge: Arc>, pub profiles: Arc>, } impl Data { pub fn global() -> &'static Data { static DATA: OnceCell = OnceCell::new(); DATA.get_or_init(|| Data { clash: Arc::new(Mutex::new(Clash::new())), verge: Arc::new(Mutex::new(Verge::new())), profiles: Arc::new(Mutex::new(Profiles::new())), }) } }