mz_ore::id_gen

Type Alias IdGen

Source
pub type IdGen = Gen<u64>;
Expand description

A generator of u64-bit IDs.

Aliased Type§

struct IdGen {
    id: u64,
    phantom: PhantomData<u64>,
}

Fields§

§id: u64§phantom: PhantomData<u64>

Implementations

Source§

impl<Id: From<u64>> Gen<Id>

Source

pub fn allocate_id(&mut self) -> Id

Allocates a new identifier of type Id and advances the generator.

Trait Implementations

Source§

impl<Id: Clone> Clone for Gen<Id>

Source§

fn clone(&self) -> Gen<Id>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Id: Debug> Debug for Gen<Id>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Id> Default for Gen<Id>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more