pub trait DigitBin: Clone + Default {
// Required methods
fn insert(&mut self, id: u64);
fn remove(&mut self, id: u64) -> bool;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn get_random(&self, rng: &mut impl Rng) -> Option<u64>;
fn get_random_and_remove(&mut self, rng: &mut impl Rng) -> Option<u64>;
}Expand description
Trait for types that can be used as leaf bins in a DigitBinIndex.
Implement this trait for any container you want to use for storing IDs in the leaf nodes.
Provided implementations: Vec<u32>, RoaringBitmap.
Required Methods§
fn insert(&mut self, id: u64)
fn remove(&mut self, id: u64) -> bool
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn get_random(&self, rng: &mut impl Rng) -> Option<u64>
fn get_random_and_remove(&mut self, rng: &mut impl Rng) -> Option<u64>
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.