Trait qecs_core::prelude::PrimaryIdManager [] [src]

pub trait PrimaryIdManager: Any + Sync + Send {
    type Id: Id;
    fn len(&self) -> usize;
    fn maximum_id_count(&self) -> usize;
    fn validate(&self, id: Self::Id) -> Option<Valid<Self::Id>>;
    unsafe fn invalidate(&mut self, id: Self::Id) -> bool;
    fn generate(&mut self) -> IdGenerationResult<Valid<Self::Id>>;
    fn activate(&mut self, id: Self::Id) -> IdActivationResult<Valid<Self::Id>, Self::Id>;
    unsafe fn clear(&mut self);
}

Associated Types

type Id: Id

Required Methods

fn len(&self) -> usize

fn maximum_id_count(&self) -> usize

fn validate(&self, id: Self::Id) -> Option<Valid<Self::Id>>

Tests if id is usable.

unsafe fn invalidate(&mut self, id: Self::Id) -> bool

Makes id unusable and returns true. Returns false if id is already invalid.

fn generate(&mut self) -> IdGenerationResult<Valid<Self::Id>>

Generates a new id.

fn activate(&mut self, id: Self::Id) -> IdActivationResult<Valid<Self::Id>, Self::Id>

unsafe fn clear(&mut self)

Implementors