#unique #u64 #helpful #uuid #utility

unique_64

A handy struct for dispatching out unique u64s as IDs

1 stable release

1.0.2 Feb 5, 2024

#3 in #helpful

Download history 21/week @ 2024-02-04 19/week @ 2024-02-18 49/week @ 2024-02-25 7/week @ 2024-03-03 10/week @ 2024-03-10 3/week @ 2024-03-17 42/week @ 2024-03-31

56 downloads per month

GPL-2.0-or-later

12KB
126 lines

Unique64

A handy struct for dispatching out unique u64s as IDs.

Please see the generated docs for how to use. It's pretty simple.

It also doesn't hold your hand. You do whatever you want with it.

But to show you without any context:

fn main() {
  let mut dispatcher = Unique64::new();

  // 0
  let x = dispatcher.get_next();

  // 1
  let y = dispatcher.get_next();

  // 0 is free again.
  dispatcher.remove(x);

  // 0
  let z = dispatcher.get_next();
}

No runtime deps