snowflaked 1.0.3

A crate for creating and working with snowflake ids
Documentation
use std::time::{Duration, SystemTime};

pub(crate) trait Time {
    fn elapsed(&self) -> Duration;
}

pub(crate) trait DefaultTime {
    const DEFAULT: Self;
}

impl Time for SystemTime {
    #[inline]
    fn elapsed(&self) -> Duration {
        self.elapsed().expect("clock went backwards")
    }
}

impl DefaultTime for SystemTime {
    const DEFAULT: Self = Self::UNIX_EPOCH;
}