mz_ore::id_gen

Type Alias AtomicIdGen

Source
pub type AtomicIdGen = AtomicGen<u64>;
Expand description

A generator of u64-bit IDs.

Atomic version of IdGen, for sharing between threads.

Aliased Type§

struct AtomicIdGen {
    id: AtomicU64,
    phantom: PhantomData<u64>,
}

Fields§

§id: AtomicU64§phantom: PhantomData<u64>

Implementations

Source§

impl<Id: From<u64> + Default> AtomicGen<Id>

Source

pub fn allocate_id(&self) -> Id

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

Trait Implementations

Source§

impl<Id: Debug> Debug for AtomicGen<Id>

Source§

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

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

impl<Id> Default for AtomicGen<Id>

Source§

fn default() -> Self

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