From ef8d2557f0ae0259d74a87b8714f064aac83f03e Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Mon, 17 May 2021 14:59:42 +0200 Subject: [PATCH] feat(wot): create static MAIN_WOT --- dubp-wot/Cargo.toml | 2 ++ dubp-wot/src/lib.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dubp-wot/Cargo.toml b/dubp-wot/Cargo.toml index 5a06042..0821f2f 100644 --- a/dubp-wot/Cargo.toml +++ b/dubp-wot/Cargo.toml @@ -14,6 +14,8 @@ path = "src/lib.rs" [dependencies] log = "0.4.8" +once_cell = "1.7" +parking_lot = "0.11" rayon = "1.3.0" serde = { version = "1.0.105", features = ["derive"] } diff --git a/dubp-wot/src/lib.rs b/dubp-wot/src/lib.rs index dbfc71b..06989dc 100644 --- a/dubp-wot/src/lib.rs +++ b/dubp-wot/src/lib.rs @@ -44,6 +44,11 @@ pub mod operations; pub use crate::data::{WebOfTrust, WotId}; +use once_cell::sync::OnceCell; + +/// Main wot instance +pub static MAIN_WOT: OnceCell<parking_lot::RwLock<data::rusty::RustyWebOfTrust>> = OnceCell::new(); + #[cfg(test)] mod tests { use super::*; -- GitLab