Skip to main content

MinstorePage

Struct MinstorePage 

Source
#[non_exhaustive]
pub struct MinstorePage<'a> { /* private fields */ }
Expand description

A parsed Minstore B+-tree page (leaf or internal/branch node).

Implementations§

Source§

impl<'a> MinstorePage<'a>

Source

pub fn parse(data: &'a [u8], offset: u64) -> Result<Self, RefsError>

Parse the Minstore node in data (a metadata page). offset is the page’s absolute byte position, used only for diagnostics.

§Errors
  • RefsError::Truncated if the page is too short to hold the node-header-offset field or the node header it points at.
Source

pub fn level(&self) -> u8

The node level (0 = leaf; higher = internal).

Source

pub fn is_leaf(&self) -> bool

True for a leaf node (level 0 and not a branch).

Source

pub fn is_branch(&self) -> bool

True for an internal/branch node (node-type flag 0x01).

Source

pub fn rows(&self) -> impl Iterator<Item = MinstoreRow<'a>> + '_

Iterate the node’s (key, value) records, skipping any record whose offset or key/value span lies outside the page (never over-reads).

Trait Implementations§

Source§

impl<'a> Debug for MinstorePage<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for MinstorePage<'a>

§

impl<'a> RefUnwindSafe for MinstorePage<'a>

§

impl<'a> Send for MinstorePage<'a>

§

impl<'a> Sync for MinstorePage<'a>

§

impl<'a> Unpin for MinstorePage<'a>

§

impl<'a> UnsafeUnpin for MinstorePage<'a>

§

impl<'a> UnwindSafe for MinstorePage<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.