Skip to main content

TreeLocation

Struct TreeLocation 

Source
pub struct TreeLocation {
    pub index: i32,
    pub ln_key: Option<Vec<u8>>,
    pub child_lsn: Lsn,
    pub child_logged_size: i32,
    pub is_kd: bool,
    pub is_embedded: bool,
}
Expand description

Cursor-like object tracking a location in a tree.

Used during recovery to track the position being processed and maintain context about the current entry’s attributes.

Fields§

§index: i32

Index within the current BIN.

§ln_key: Option<Vec<u8>>

The key at this location (if known).

§child_lsn: Lsn

LSN of the child at this location.

§child_logged_size: i32

Logged size of the child entry.

§is_kd: bool

True if this entry is known deleted.

§is_embedded: bool

True if this is an embedded LN.

Implementations§

Source§

impl TreeLocation

Source

pub fn new() -> Self

Creates a new TreeLocation with default values.

Source

pub fn with_index_and_key(index: i32, ln_key: Vec<u8>) -> Self

Creates a TreeLocation with specific index and key.

§Arguments
  • index - The slot index in the BIN
  • ln_key - The key at this location
Source

pub fn reset(&mut self)

Resets all fields to their default values.

This allows reusing a TreeLocation instance.

Source

pub fn has_valid_index(&self) -> bool

Returns true if this location has a valid index.

Source

pub fn has_key(&self) -> bool

Returns true if a key is present at this location.

Source

pub fn key_as_slice(&self) -> Option<&[u8]>

Returns the key as a slice, if present.

Source

pub fn set_key(&mut self, key: Vec<u8>)

Sets the key at this location.

Source

pub fn clear_key(&mut self)

Clears the key at this location.

Trait Implementations§

Source§

impl Clone for TreeLocation

Source§

fn clone(&self) -> TreeLocation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TreeLocation

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for TreeLocation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.