Slab

Struct Slab 

Source
pub struct Slab(/* private fields */);

Implementations§

Source§

impl Slab

Source

pub fn new(bytes: &mut [u8]) -> &mut Self

Creates a slab that holds and references the bytes

let slab = {
    let mut bytes = [10; 100];
    serum_dex::critbit::Slab::new(&mut bytes)
};
Source

pub fn assert_minimum_capacity(&self, capacity: u32) -> DexResult

Source§

impl Slab

Source

pub fn find_min(&self) -> Option<NodeHandle>

Source

pub fn find_max(&self) -> Option<NodeHandle>

Source

pub fn insert_leaf( &mut self, new_leaf: &LeafNode, ) -> Result<(NodeHandle, Option<LeafNode>), SlabTreeError>

Source

pub fn remove_by_key(&mut self, search_key: u128) -> Option<LeafNode>

Source

pub fn remove_min(&mut self) -> Option<LeafNode>

Source

pub fn remove_max(&mut self) -> Option<LeafNode>

Trait Implementations§

Source§

impl SlabView<AnyNode> for Slab

Source§

fn capacity(&self) -> u64

Source§

fn clear(&mut self)

Source§

fn is_empty(&self) -> bool

Source§

fn get(&self, key: u32) -> Option<&AnyNode>

Source§

fn get_mut(&mut self, key: u32) -> Option<&mut AnyNode>

Source§

fn insert(&mut self, val: &AnyNode) -> Result<u32, ()>

Source§

fn remove(&mut self, key: u32) -> Option<AnyNode>

Source§

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

Auto Trait Implementations§

§

impl Freeze for Slab

§

impl RefUnwindSafe for Slab

§

impl Send for Slab

§

impl !Sized for Slab

§

impl Sync for Slab

§

impl Unpin for Slab

§

impl UnwindSafe for Slab

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more