Trait qecs_core::prelude::PrimaryIdManager
[−]
[src]
pub trait PrimaryIdManager: Any + Sync + Send where Self: for<'a> _PrimaryIdManager<'a, _Id=Self::Id> { 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); fn iter<'a>(&'a self) -> Self::Iter; }
Associated Types
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.