photonic 0.1.1

Dynamic light controller and animator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::atomic::{AtomicU64, Ordering};

#[derive(Copy, Clone, Eq, PartialEq, Hash)]
pub struct Trigger(u64);

static NEXT: AtomicU64 = AtomicU64::new(0);

impl Trigger {
    pub fn next() -> Self {
        let next = NEXT.fetch_add(1, Ordering::Relaxed);
        return Self(next);
    }
}