#[repr(C, align(8))]pub struct DirectNode<'a, V> { /* private fields */ }Expand description
direct node descriptor for memory pointer, normally a tiny memory buffer
SAFETY: node operations in immutable by unsafe code, this works because all ops for same node are expected to be ran in a single thread
Implementations§
Source§impl<'a, V> DirectNode<'a, V>
impl<'a, V> DirectNode<'a, V>
pub fn from_slice(buf: &[u8]) -> Self
pub fn new(size: usize) -> Option<Self>
pub fn copy_from_slice(buf: &[u8]) -> Option<Self>
pub fn init(&self, flags: usize, level: usize, nchild: usize)
pub fn get_val(&self, index: usize) -> &V
pub fn set_val(&self, index: usize, val: &V)
pub fn get_userdata(&self) -> u32
pub fn set_userdata(&self, data: u32)
pub fn get_capacity(&self) -> usize
pub fn as_ref(&self) -> &[u8] ⓘ
pub fn as_mut(&self) -> &mut [u8] ⓘ
Trait Implementations§
Source§impl<'a, V: Debug> Debug for DirectNode<'a, V>
impl<'a, V: Debug> Debug for DirectNode<'a, V>
Source§impl<'a, V> Display for DirectNode<'a, V>
impl<'a, V> Display for DirectNode<'a, V>
Auto Trait Implementations§
impl<'a, V> Freeze for DirectNode<'a, V>
impl<'a, V> RefUnwindSafe for DirectNode<'a, V>where
V: RefUnwindSafe,
impl<'a, V> !Send for DirectNode<'a, V>
impl<'a, V> !Sync for DirectNode<'a, V>
impl<'a, V> !Unpin for DirectNode<'a, V>
impl<'a, V> !UnwindSafe for DirectNode<'a, V>
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