#[derive(Debug)] pub struct IdGen { next: u64, } impl IdGen { pub fn new(start: u64) -> Self { IdGen { next: start } } pub fn gen(&mut self) -> u64 { let res = self.next; self.next += 1; res } }