pub struct BeTree { /* private fields */ }Expand description
Buffered Bε-tree over (RowId, Epoch) → Row.
Implementations§
Source§impl BeTree
impl BeTree
pub fn new() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn insert_row(&mut self, row: Row)
pub fn insert_row(&mut self, row: Row)
Insert a row version (keyed by its own (row_id, committed_epoch)).
Sourcepub fn get(&self, row_id: RowId, snapshot: Epoch) -> Option<Row>
pub fn get(&self, row_id: RowId, snapshot: Epoch) -> Option<Row>
Newest version of row_id with epoch <= snapshot, including tombstones
(returned as a Row with deleted=true). None if no such version.
Sourcepub fn get_version(
&self,
row_id: RowId,
snapshot: Epoch,
) -> Option<(Epoch, Row)>
pub fn get_version( &self, row_id: RowId, snapshot: Epoch, ) -> Option<(Epoch, Row)>
Same as Self::get but also returns the version’s epoch — the shape
the engine’s MVCC merge needs to pick the newest version across the
memtable, the mutable-run tier, and sorted runs.
Sourcepub fn get_visible(&self, row_id: RowId, snapshot: Epoch) -> Option<Row>
pub fn get_visible(&self, row_id: RowId, snapshot: Epoch) -> Option<Row>
Visible (non-deleted) row at row_id for snapshot.
Sourcepub fn versions(&self) -> Vec<Row>
pub fn versions(&self) -> Vec<Row>
Every buffered version (non-consuming), in no defined order — leaves
plus every internal-node buffer. Used by the memtable adapter to dedup
the newest visible version per RowId for a full visible-rows scan.
Sourcepub fn into_sorted_rows(self) -> Vec<Row>
pub fn into_sorted_rows(self) -> Vec<Row>
Consume the tree, flushing all buffers to leaves, returning every version
in ascending (RowId, Epoch) order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BeTree
impl RefUnwindSafe for BeTree
impl Send for BeTree
impl Sync for BeTree
impl Unpin for BeTree
impl UnsafeUnpin for BeTree
impl UnwindSafe for BeTree
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
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>
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>
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