caretta-sync/id/src/lib.rs

25 lines
431 B
Rust
Raw Normal View History

2025-09-13 08:39:06 +09:00
mod single;
2025-09-12 09:27:14 +09:00
mod double;
mod error;
mod triple;
2025-09-13 12:29:59 +09:00
mod utils;
2025-09-12 09:27:14 +09:00
2025-09-13 08:39:06 +09:00
use rand::Rng;
pub use single::*;
pub use double::*;
pub use triple::*;
pub use error::*;
const DOUBLE_ID_SIZE: u32 = (SingleId::SIZE as u32).pow(2);
const TRIPLE_ID_SIZE: u64 = (SingleId::SIZE as u64).pow(3);
pub trait Id {
type SizeType;
const NIL: Self;
const MAX: Self;
const SIZE: Self::SizeType;
2025-09-13 12:29:59 +09:00
#[cfg(test)]
fn is_valid(&self) -> bool;
}