pub struct BTreeV2Header {
pub btree_type: u8,
pub node_size: u32,
pub record_size: u16,
pub depth: u16,
pub split_percent: u8,
pub merge_percent: u8,
pub root_node_address: u64,
pub num_records_in_root: u16,
pub total_records: u64,
}Expand description
Parsed B-tree v2 header.
Fields§
§btree_type: u8B-tree type (determines the record format).
node_size: u32Size in bytes of each B-tree node (both internal and leaf).
record_size: u16Size in bytes of each record.
depth: u16Depth of the tree (0 = root is a leaf).
split_percent: u8Percent full at which to split a node.
merge_percent: u8Percent full at which to merge a node.
root_node_address: u64Address of the root node.
num_records_in_root: u16Number of records in the root node.
total_records: u64Total number of records in the entire tree.
Implementations§
Source§impl BTreeV2Header
impl BTreeV2Header
Sourcepub fn parse(
cursor: &mut Cursor<'_>,
offset_size: u8,
length_size: u8,
) -> Result<Self>
pub fn parse( cursor: &mut Cursor<'_>, offset_size: u8, length_size: u8, ) -> Result<Self>
Parse a B-tree v2 header at the current cursor position.
Format:
- Signature:
BTHD(4 bytes) - Version: 0 (1 byte)
- B-tree type (u8)
- Node size (u32 LE)
- Record size (u16 LE)
- Depth (u16 LE)
- Split percent (u8)
- Merge percent (u8)
- Root node address (
offset_sizebytes) - Number of records in root node (u16 LE)
- Total number of records in tree (
length_sizebytes) - Checksum (u32 LE)
Trait Implementations§
Source§impl Clone for BTreeV2Header
impl Clone for BTreeV2Header
Source§fn clone(&self) -> BTreeV2Header
fn clone(&self) -> BTreeV2Header
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 BTreeV2Header
impl RefUnwindSafe for BTreeV2Header
impl Send for BTreeV2Header
impl Sync for BTreeV2Header
impl Unpin for BTreeV2Header
impl UnsafeUnpin for BTreeV2Header
impl UnwindSafe for BTreeV2Header
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