Skip to main content

SlotFetch

Struct SlotFetch 

Source
pub struct SlotFetch {
    pub found: bool,
    pub data: Option<Vec<u8>>,
    pub lsn: u64,
    pub slot_index: usize,
    pub bin_arc: Arc<RwLock<TreeNode>>,
}
Expand description

Combined search result carrying slot data and the BIN arc, returned by Tree::search_with_data.

Avoids the double-descent pattern where Tree::search checked key existence and a second call re-descended to fetch the actual slot bytes. One descent now serves both purposes (Wave-11-I optimisation).

Fields§

§found: bool

true if an exact key match was found and is not expired.

§data: Option<Vec<u8>>

Data bytes for the slot (None when found is false).

§lsn: u64

Raw slot LSN as u64; zero when found is false.

§slot_index: usize

Slot index within the BIN. Set to the actual BIN slot index when found is true; 0 otherwise.

Used by CursorImpl to set current_index correctly so that retrieve_next advances to the right slot after a search.

§bin_arc: Arc<RwLock<TreeNode>>

Arc to the BIN that the descent reached. Always Some when the tree has at least one node, regardless of whether found is true.

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> 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 = 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.