pub struct BTreeV1Node {
pub node_type: u8,
pub level: u8,
pub entries_used: u16,
pub left_sibling: u64,
pub right_sibling: u64,
pub keys: Vec<BTreeV1Key>,
pub children: Vec<u64>,
}Expand description
A parsed v1 B-tree node.
Fields§
§node_type: u8Node type: 0 = group, 1 = raw data chunk.
level: u8Node level: 0 = leaf, > 0 = internal.
entries_used: u16Number of entries (children) actually in use.
left_sibling: u64Address of the left sibling node (undefined if none).
right_sibling: u64Address of the right sibling node (undefined if none).
keys: Vec<BTreeV1Key>Keys bracketing the children. Length is entries_used + 1.
children: Vec<u64>Child addresses. Length is entries_used.
Implementations§
Source§impl BTreeV1Node
impl BTreeV1Node
Sourcepub fn parse(
cursor: &mut Cursor<'_>,
offset_size: u8,
length_size: u8,
ndims: Option<u32>,
) -> Result<Self>
pub fn parse( cursor: &mut Cursor<'_>, offset_size: u8, length_size: u8, ndims: Option<u32>, ) -> Result<Self>
Parse a v1 B-tree node at the current cursor position.
ndims is required for type-1 (raw data chunk) nodes — it is the
number of dimensions of the dataset’s dataspace. For type-0 (group)
nodes pass None.
Format:
- Signature:
TREE(4 bytes) - Node type (u8): 0 = group, 1 = raw data
- Node level (u8)
- Entries used (u16 LE)
- Left sibling address (
offset_sizebytes) - Right sibling address (
offset_sizebytes) - Then interleaved keys and child pointers: key[0], child[0], key[1], child[1], …, key[K-1], child[K-1], key[K] where K = entries_used.
Trait Implementations§
Source§impl Clone for BTreeV1Node
impl Clone for BTreeV1Node
Source§fn clone(&self) -> BTreeV1Node
fn clone(&self) -> BTreeV1Node
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BTreeV1Node
impl RefUnwindSafe for BTreeV1Node
impl Send for BTreeV1Node
impl Sync for BTreeV1Node
impl Unpin for BTreeV1Node
impl UnsafeUnpin for BTreeV1Node
impl UnwindSafe for BTreeV1Node
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more