#[repr(C)]
pub struct RedBlackTree<K: PartialOrd + Ord + Copy + Clone + Default + Pod + Zeroable, V: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> { pub root: u32, /* private fields */ }

Fields§

§root: u32

Implementations§

source§

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

source

pub fn pretty_print(&self)

source

pub fn is_valid_red_black_tree(&self) -> bool

source

pub fn new() -> Self

source

pub fn initialize(&mut self)

source

pub fn get_node(&self, node: u32) -> &RBNode<K, V>

source

pub fn get_node_mut(&mut self, node: u32) -> &mut RBNode<K, V>

source

pub fn is_red(&self, node: u32) -> bool

source

pub fn is_black(&self, node: u32) -> bool

source

pub fn get_child(&self, node: u32, dir: u32) -> u32

source

pub fn is_leaf(&self, node: u32) -> bool

source

pub fn is_root(&self, node: u32) -> bool

source

pub fn get_dir(&self, node: u32, dir: u32) -> u32

source

pub fn get_left(&self, node: u32) -> u32

source

pub fn get_right(&self, node: u32) -> u32

source

pub fn get_color(&self, node: u32) -> u32

source

pub fn get_parent(&self, node: u32) -> u32

source

pub fn get_addr(&self, key: &K) -> u32

Trait Implementations§

source§

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

source§

fn clone(&self) -> RedBlackTree<K, V, MAX_SIZE>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

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

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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

source§

fn new_from_slice(slice: &mut [u8]) -> &mut Self

source§

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

§

type Output = V

The returned type after indexing.
source§

fn index(&self, index: &K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

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

source§

fn index_mut(&mut self, index: &K) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

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

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = RedBlackTreeIterator<'a, K, V, MAX_SIZE>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, K: Debug + PartialOrd + Ord + Copy + Clone + Default + Pod + Zeroable, V: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> IntoIterator for &'a mut RedBlackTree<K, V, MAX_SIZE>

§

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.
§

type IntoIter = RedBlackTreeIteratorMut<'a, K, V, MAX_SIZE>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
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§

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)> + '_>

source§

fn is_empty(&self) -> bool

source§

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

source§

fn get_min_index(&mut self) -> u32

source§

fn get_max_index(&mut self) -> u32

source§

fn get_min(&mut self) -> Option<(K, V)>

source§

fn get_max(&mut self) -> Option<(K, V)>

source§

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

source§

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

source§

fn zeroed() -> Self

source§

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

source§

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

Auto Trait Implementations§

§

impl<K, V, const MAX_SIZE: usize> RefUnwindSafe for RedBlackTree<K, V, MAX_SIZE>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V, const MAX_SIZE: usize> Send for RedBlackTree<K, V, MAX_SIZE>where K: Send, V: Send,

§

impl<K, V, const MAX_SIZE: usize> Sync for RedBlackTree<K, V, MAX_SIZE>where K: Sync, V: Sync,

§

impl<K, V, const MAX_SIZE: usize> Unpin for RedBlackTree<K, V, MAX_SIZE>where K: Unpin, V: Unpin,

§

impl<K, V, const MAX_SIZE: usize> UnwindSafe for RedBlackTree<K, V, MAX_SIZE>where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,

§

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

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> NoUninit for Twhere T: Pod,