pub trait NodeAllocatorMap<K, V> {
    // Required methods
    fn insert(&mut self, key: K, value: V) -> Option<u32>;
    fn remove(&mut self, key: &K) -> Option<V>;
    fn contains(&self, key: &K) -> bool;
    fn get(&self, key: &K) -> Option<&V>;
    fn get_mut(&mut self, key: &K) -> Option<&mut V>;
    fn size(&self) -> usize;
    fn len(&self) -> usize;
    fn capacity(&self) -> usize;
    fn iter(&self) -> Box<dyn DoubleEndedIterator<Item = (&K, &V)> + '_>;
    fn iter_mut(
        &mut self
    ) -> Box<dyn DoubleEndedIterator<Item = (&K, &mut V)> + '_>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

This trait provides an API for map-like data structures that use the NodeAllocator struct as the underlying container

Required Methods§

source

fn insert(&mut self, key: K, value: V) -> Option<u32>

source

fn remove(&mut self, key: &K) -> Option<V>

source

fn contains(&self, key: &K) -> bool

source

fn get(&self, key: &K) -> Option<&V>

source

fn get_mut(&mut self, key: &K) -> Option<&mut V>

source

fn size(&self) -> usize

👎Deprecated
source

fn len(&self) -> usize

source

fn capacity(&self) -> usize

source

fn iter(&self) -> Box<dyn DoubleEndedIterator<Item = (&K, &V)> + '_>

source

fn iter_mut(&mut self) -> Box<dyn DoubleEndedIterator<Item = (&K, &mut V)> + '_>

Provided Methods§

source

fn is_empty(&self) -> bool

Implementors§

source§

impl<K: PartialOrd + Copy + Clone + Default + Pod + Zeroable, V: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> NodeAllocatorMap<K, V> for AVLTree<K, V, MAX_SIZE>

source§

impl<K: Debug + PartialOrd + Ord + Copy + Clone + Default + Pod + Zeroable, V: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> NodeAllocatorMap<K, V> for RedBlackTree<K, V, MAX_SIZE>

source§

impl<K: Hash + PartialEq + Copy + Clone + Default + Pod + Zeroable, V: Default + Copy + Clone + Pod + Zeroable, const NUM_BUCKETS: usize, const MAX_SIZE: usize> NodeAllocatorMap<K, V> for HashTable<K, V, NUM_BUCKETS, 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>