#[repr(C, align(8))]pub struct BtreeNode<'a, K, V, P> { /* private fields */ }Expand description
btree node descriptor for memory pointer, normally a page
SAFETY: node operations mutable by unsafe code, this works because all ops for same node are expected to be ran in a single thread
Implementations§
Source§impl<'a, K, V, P> BtreeNode<'a, K, V, P>
impl<'a, K, V, P> BtreeNode<'a, K, V, P>
pub fn from_slice(buf: &[u8]) -> Self
pub fn new(size: usize) -> Option<Self>
pub fn new_with_id(size: usize, id: &P) -> Option<Self>
pub fn copy_from_slice(id: P, buf: &[u8]) -> Option<Self>
pub fn as_ref(&self) -> &[u8] ⓘ
pub fn as_mut(&self) -> &mut [u8] ⓘ
pub fn is_leaf(&self) -> bool
pub fn set_leaf(&self)
pub fn clear_leaf(&self)
pub fn is_large(&self) -> bool
pub fn set_large(&self)
pub fn clear_large(&self)
pub fn get_flags(&self) -> u8
pub fn set_flags(&self, flags: u8)
pub fn get_level(&self) -> usize
pub fn set_level(&self, level: usize)
pub fn get_key(&self, index: usize) -> &K
pub fn set_key(&self, index: usize, key: &K)
pub fn get_val<X>(&self, index: usize) -> &X
pub fn set_val<X>(&self, index: usize, val: &X)
pub fn get_nchild(&self) -> usize
pub fn set_nchild(&self, c: usize)
pub fn set_nchild_use_p(&self, c: usize)
pub fn get_userdata(&self) -> u32
pub fn set_userdata(&self, data: u32)
pub fn get_capacity(&self) -> usize
pub fn get_v_capacity(&self) -> usize
pub fn has_free_slots(&self) -> bool
pub fn get_nchild_min(&self) -> usize
pub fn is_overflowing(&self) -> bool
pub fn node_key(&self) -> &K
pub fn id(&self) -> &P
pub fn set_id(&self, id: P)
pub fn init(&self, level: usize, nchild: usize)
pub fn init_root(&self, level: usize, is_large: bool)
pub fn is_dirty(&self) -> bool
pub fn mark_dirty(&self)
pub fn clear_dirty(&self)
pub fn move_left( left: &BtreeNode<'_, K, V, P>, right: &BtreeNode<'_, K, V, P>, n: usize, )
pub fn move_right( left: &BtreeNode<'_, K, V, P>, right: &BtreeNode<'_, K, V, P>, n: usize, )
pub fn lookup(&self, key: &K) -> (bool, usize)
pub fn insert<X>(&self, index: usize, key: &K, val: &X)
pub fn delete<X: Copy>(&self, index: usize, key: &mut K, val: &mut X)
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, P> Freeze for BtreeNode<'a, K, V, P>where
P: Freeze,
impl<'a, K, V, P> RefUnwindSafe for BtreeNode<'a, K, V, P>
impl<'a, K, V, P> !Send for BtreeNode<'a, K, V, P>
impl<'a, K, V, P> !Sync for BtreeNode<'a, K, V, P>
impl<'a, K, V, P> !Unpin for BtreeNode<'a, K, V, P>
impl<'a, K, V, P> !UnwindSafe for BtreeNode<'a, K, V, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more