pub struct Nodes { /* private fields */ }Expand description
The .bt di-node array: the key at every M-th position.
Copied out of the mapping into one compact arena at first use, so the narrowing
search touches only hot, contiguous heap instead of faulting .bt pages scattered
across a multi-gigabyte file.
Implementations§
Source§impl Nodes
impl Nodes
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
Heap held by the arena and (when present) the offset table.
Sourcepub fn narrow(&self, key: &[u8]) -> (u64, u64)
pub fn narrow(&self, key: &[u8]) -> (u64, u64)
Narrow a search for key to the half-open key-index range that can contain it.
Node j is key j * M, and keys are sorted, so if node[j] <= key < node[j+1]
then key, if present, lies in [j*M, (j+1)*M). Returns an empty range when
key sorts before the very first key, which cannot be in the file at all.
Auto Trait Implementations§
impl Freeze for Nodes
impl RefUnwindSafe for Nodes
impl Send for Nodes
impl Sync for Nodes
impl Unpin for Nodes
impl UnsafeUnpin for Nodes
impl UnwindSafe for Nodes
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