IdAllocator

Trait IdAllocator 

Source
pub trait IdAllocator<Tag> {
    // Required methods
    fn new(limit: usize) -> Self;
    fn try_allocate_id(&self) -> Option<Id<Tag>>;
    fn free_id(&self, id: Id<Tag>);
    fn id_limit(&self) -> usize;
    fn raise_id_limit(&mut self, new_limit: usize);
}

Required Methods§

Source

fn new(limit: usize) -> Self

Source

fn try_allocate_id(&self) -> Option<Id<Tag>>

Source

fn free_id(&self, id: Id<Tag>)

Source

fn id_limit(&self) -> usize

Source

fn raise_id_limit(&mut self, new_limit: usize)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§