Struct pancake_engine_ssi::lsm::lsm_state::LsmState
source · 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: ListVerImplementations§
source§impl LsmState
impl LsmState
sourcepub fn new(
committed_units: impl IntoIterator<Item = CommittedUnit>,
curr_commit_ver: CommitVer
) -> Self
pub fn new( committed_units: impl IntoIterator<Item = CommittedUnit>, curr_commit_ver: CommitVer ) -> Self
@arg committed_units: From newer to older.
pub fn list(&self) -> &AtomicLinkedList<CommittedUnit>
pub fn list_mut(&mut self) -> &mut AtomicLinkedList<CommittedUnit>
pub fn boundaries(&self) -> &OrderedDict<CommitVer, Boundary>
pub fn boundaries_mut(&mut self) -> &mut OrderedDict<CommitVer, Boundary>
pub fn curr_commit_ver(&self) -> CommitVer
pub fn hold_curr_commit_ver(&mut self) -> CommitVer
sourcepub fn unhold_commit_vers<const LEN: usize>(
&mut self,
arg_vers: [Option<CommitVer>; LEN]
) -> Result<[Option<CommitVer>; LEN]>
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.
sourcepub fn unhold_commit_ver(&mut self, arg_ver: &CommitVer) -> Result<bool>
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.
pub fn bump_commit_ver(&mut self, staging_unit: StagingUnit) -> Result<()>
sourcepub fn fetch_inc_curr_list_ver(&mut self) -> (ListVer, Option<ListVer>)
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.
sourcepub fn hold_curr_list_ver(&mut self) -> ListVer
pub fn hold_curr_list_ver(&mut self) -> ListVer
@return The curr_list_ver.
sourcepub fn unhold_list_ver(&mut self, arg_ver: ListVer) -> Result<Option<ListVer>>
pub fn unhold_list_ver(&mut self, arg_ver: ListVer) -> Result<Option<ListVer>>
@return The updated min_held_list_ver, iff updated.
fn advance_min_held_list_ver(&mut self) -> Option<ListVer>
sourcepub fn hold_and_unhold_list_ver(
&mut self,
prior: ListVer
) -> Result<(ListVer, Option<ListVer>)>
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.
pub fn is_held_list_vers_empty(&self) -> bool
Auto Trait Implementations§
impl RefUnwindSafe for LsmState
impl Send for LsmState
impl Sync for LsmState
impl Unpin for LsmState
impl UnwindSafe for LsmState
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
Mutably borrows from an owned value. Read more