ps-uuid 0.1.0-0

An opinionated UUID implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod implementations;
mod methods;

use std::{sync::Arc, time::SystemTime};

use once_cell::sync::Lazy;
use parking_lot::Mutex;

use crate::NodeId;

#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct State {
    pub last_ts: SystemTime,
    pub node_id: NodeId,
    pub seq: u16,
}

pub static STATE: Lazy<Arc<Mutex<State>>> = Lazy::new(|| Arc::new(Mutex::new(State::default())));