atomic_state/state/mod.rs
1pub mod guard; pub use guard::AtomicStateGuard;
2pub mod state; pub use state::AtomicState;
3
4use crate::prelude::*;
5
6pub(super) const ERR_MSG: &str = "The State data has been poisoned!";
7
8/// A static data alias
9pub type State<T> = Lazy<AtomicState<T>>;
10
11/// Initializes a static data
12#[macro_export]
13macro_rules! state {
14 ($v:expr) => {{
15 ::atomic_state::Lazy::new(|| ::atomic_state::AtomicState::new($v))
16 }}
17}