pub struct LsmState {
    list: AtomicLinkedList<CommittedUnit>,
    curr_commit_ver: CommitVer,
    curr_commit_ver_hold_count: u32,
    boundaries: OrderedDict<CommitVer, Boundary>,
    curr_list_ver: ListVer,
    held_list_vers: Multiset<ListVer>,
    min_held_list_ver: ListVer,
}

Fields§

§list: AtomicLinkedList<CommittedUnit>

From newer to older.

§curr_commit_ver: CommitVer§curr_commit_ver_hold_count: u32§boundaries: OrderedDict<CommitVer, Boundary>§curr_list_ver: ListVer§held_list_vers: Multiset<ListVer>§min_held_list_ver: ListVer

Implementations§

source§

impl LsmState

source

pub fn new( committed_units: impl IntoIterator<Item = CommittedUnit>, curr_commit_ver: CommitVer ) -> Self

@arg committed_units: From newer to older.

source

pub fn list(&self) -> &AtomicLinkedList<CommittedUnit>

source

pub fn list_mut(&mut self) -> &mut AtomicLinkedList<CommittedUnit>

source

pub fn boundaries(&self) -> &OrderedDict<CommitVer, Boundary>

source

pub fn boundaries_mut(&mut self) -> &mut OrderedDict<CommitVer, Boundary>

source

pub fn curr_commit_ver(&self) -> CommitVer

source

pub fn hold_curr_commit_ver(&mut self) -> CommitVer

source

pub fn unhold_commit_vers<const LEN: usize>( &mut self, arg_vers: [Option<CommitVer>; LEN] ) -> Result<[Option<CommitVer>; LEN]>

@return CommitVers that are members of newly-found isolated sequences of non-held boundaries.

source

pub fn unhold_commit_ver(&mut self, arg_ver: &CommitVer) -> Result<bool>

@return Whether (the unholding caused a non-head boundary to become non-held) && and (the non-held boundary is isolatedly non-held).

We must unhold and check for isolated-non-held-ness back-to-back, when we’re unholding multiple CommitVers, to ensure that among 2 adjacent unheld CommitVers that become isolated-non-held, 1 of them is detected.

source

pub fn bump_commit_ver(&mut self, staging_unit: StagingUnit) -> Result<()>

source

pub fn fetch_inc_curr_list_ver(&mut self) -> (ListVer, Option<ListVer>)

@return

  • tup.0 = The previously “curr”, newly “penultimate”, ListVer.
  • tup.1 = The updated min_held_list_ver, iff updated.
source

pub fn hold_curr_list_ver(&mut self) -> ListVer

@return The curr_list_ver.

source

pub fn unhold_list_ver(&mut self, arg_ver: ListVer) -> Result<Option<ListVer>>

@return The updated min_held_list_ver, iff updated.

source

fn advance_min_held_list_ver(&mut self) -> Option<ListVer>

source

pub fn hold_and_unhold_list_ver( &mut self, prior: ListVer ) -> Result<(ListVer, Option<ListVer>)>

@return

  • tup.0 = The curr_list_ver.
  • tup.1 = The updated min_held_list_ver, iff updated.
source

pub fn is_held_list_vers_empty(&self) -> bool

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>,

§

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>,

§

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

impl<T> Erased for T