meritrank/walk.rs
1use uuid::Uuid;
2
3use rand::thread_rng;
4use rand::Rng;
5
6pub type WalkId = Uuid;
7
8pub struct WalkIdGenerator {
9 id: WalkId,
10}
11
12impl WalkIdGenerator {
13 pub fn new() -> Self {
14 WalkIdGenerator {
15 id: Uuid::from_u128(thread_rng().gen()),
16 }
17 }
18
19 pub fn get_id(&self) -> WalkId {
20 self.id
21 }
22}