#[repr(C)]pub struct Critbit<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> {
pub root: u32,
/* private fields */
}
Fields§
§root: u32
Root node of the critbit tree
Implementations§
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Critbit<V, NUM_NODES, MAX_SIZE>
pub fn new() -> Self
pub fn initialize(&mut self)
pub fn get_leaf(&self, leaf_index: u32) -> &V
pub fn get_leaf_mut(&mut self, leaf_index: u32) -> &mut V
pub fn is_inner_node(&self, node: u32) -> bool
pub fn get_node(&self, node: u32) -> CritbitNode
pub fn get_key(&self, node: u32) -> &u128
pub fn get_left(&self, node: u32) -> u32
pub fn get_right(&self, node: u32) -> u32
pub fn get_parent(&self, node: u32) -> u32
pub fn get_node_mut(&mut self, node: u32) -> &mut CritbitNode
pub fn get_addr(&self, key: u128) -> u32
Trait Implementations§
source§impl<V: Clone + Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Clone for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Clone + Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Clone for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Default for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Default for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> FromSlice for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> FromSlice for Critbit<V, NUM_NODES, MAX_SIZE>
fn new_from_slice(slice: &mut [u8]) -> &mut Self
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Index<u128> for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Index<u128> for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> IndexMut<u128> for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> IndexMut<u128> for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<'a, V: Default + Copy + Clone + Pod + Zeroable, const MAX_NODES: usize, const MAX_SIZE: usize> IntoIterator for &'a Critbit<V, MAX_NODES, MAX_SIZE>
impl<'a, V: Default + Copy + Clone + Pod + Zeroable, const MAX_NODES: usize, const MAX_SIZE: usize> IntoIterator for &'a Critbit<V, MAX_NODES, MAX_SIZE>
source§impl<'a, V: Default + Copy + Clone + Pod + Zeroable, const MAX_NODES: usize, const MAX_SIZE: usize> IntoIterator for &'a mut Critbit<V, MAX_NODES, MAX_SIZE>
impl<'a, V: Default + Copy + Clone + Pod + Zeroable, const MAX_NODES: usize, const MAX_SIZE: usize> IntoIterator for &'a mut Critbit<V, MAX_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> NodeAllocatorMap<u128, V> for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> NodeAllocatorMap<u128, V> for Critbit<V, NUM_NODES, MAX_SIZE>
fn insert(&mut self, key: u128, value: V) -> Option<u32>
fn remove(&mut self, key: &u128) -> Option<V>
fn contains(&self, key: &u128) -> bool
fn get(&self, key: &u128) -> Option<&V>
fn get_mut(&mut self, key: &u128) -> Option<&mut V>
fn len(&self) -> usize
fn capacity(&self) -> usize
fn iter(&self) -> Box<dyn DoubleEndedIterator<Item = (&u128, &V)> + '_>
fn iter_mut( &mut self ) -> Box<dyn DoubleEndedIterator<Item = (&u128, &mut V)> + '_>
fn is_empty(&self) -> bool
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> OrderedNodeAllocatorMap<u128, V> for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> OrderedNodeAllocatorMap<u128, V> for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> ZeroCopy for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> ZeroCopy for Critbit<V, NUM_NODES, MAX_SIZE>
source§impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Zeroable for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Zeroable for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Copy + Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Copy for Critbit<V, NUM_NODES, MAX_SIZE>
impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Pod for Critbit<V, NUM_NODES, MAX_SIZE>
Auto Trait Implementations§
impl<V, const NUM_NODES: usize, const MAX_SIZE: usize> RefUnwindSafe for Critbit<V, NUM_NODES, MAX_SIZE>where V: RefUnwindSafe,
impl<V, const NUM_NODES: usize, const MAX_SIZE: usize> Send for Critbit<V, NUM_NODES, MAX_SIZE>where V: Send,
impl<V, const NUM_NODES: usize, const MAX_SIZE: usize> Sync for Critbit<V, NUM_NODES, MAX_SIZE>where V: Sync,
impl<V, const NUM_NODES: usize, const MAX_SIZE: usize> Unpin for Critbit<V, NUM_NODES, MAX_SIZE>where V: Unpin,
impl<V, const NUM_NODES: usize, const MAX_SIZE: usize> UnwindSafe for Critbit<V, NUM_NODES, MAX_SIZE>where V: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.