Struct sokoban::critbit::Critbit

source ·
#[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>

source

pub fn new() -> Self

source

pub fn initialize(&mut self)

source

pub fn get_leaf(&self, leaf_index: u32) -> &V

source

pub fn get_leaf_mut(&mut self, leaf_index: u32) -> &mut V

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn get_node_mut(&mut self, node: u32) -> &mut CritbitNode

source

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>

source§

fn clone(&self) -> Critbit<V, NUM_NODES, 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<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Default for Critbit<V, NUM_NODES, MAX_SIZE>

source§

fn default() -> Self

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

impl<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> FromSlice for Critbit<V, NUM_NODES, MAX_SIZE>

source§

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>

§

type Output = V

The returned type after indexing.
source§

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

Performs the indexing (container[index]) operation. Read more
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>

source§

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

Performs the mutable indexing (container[index]) operation. Read more
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>

§

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

The type of the elements being iterated over.
§

type IntoIter = CritbitIterator<'a, V, MAX_NODES, 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, V: Default + Copy + Clone + Pod + Zeroable, const MAX_NODES: usize, const MAX_SIZE: usize> IntoIterator for &'a mut Critbit<V, MAX_NODES, MAX_SIZE>

§

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

The type of the elements being iterated over.
§

type IntoIter = CritbitIteratorMut<'a, V, MAX_NODES, 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<V: Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> NodeAllocatorMap<u128, V> for Critbit<V, NUM_NODES, MAX_SIZE>

source§

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

source§

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

source§

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

source§

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

source§

fn get_mut(&mut self, key: &u128) -> 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 = (&u128, &V)> + '_>

source§

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

source§

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>

source§

fn get_min_index(&mut self) -> u32

source§

fn get_max_index(&mut self) -> u32

source§

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

source§

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

source§

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>

source§

fn zeroed() -> Self

source§

impl<V: Copy + Default + Copy + Clone + Pod + Zeroable, const NUM_NODES: usize, const MAX_SIZE: usize> Copy for Critbit<V, NUM_NODES, MAX_SIZE>

source§

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> 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,