flutter_rust_bridge 2.12.0

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::misc::atomic::{AtomicU64, Ordering};

#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub struct LockableOrder(u64);

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

impl LockableOrder {
    pub(crate) fn new() -> Self {
        let value = COUNTER.fetch_add(1, Ordering::Relaxed);
        Self(value)
    }

    #[cfg(test)]
    pub fn new_for_test(value: u64) -> Self {
        Self(value)
    }
}