pub struct IdAllocator { /* private fields */ }
Expand description

An unique ID allocator that allows management of IDs in a given interval.

Implementations

Creates a new instance of IdAllocator that will be used to manage the allocation and release of ids from the interval specified by range_base and range_end

Allocate an ID from the managed range. We first try to reuse one of the IDs released before. If there is no ID to reuse we return the next available one from the managed range.

Frees an id from the managed range.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.