Skip to main content

DualProtectedCommitStore

Trait DualProtectedCommitStore 

Source
pub trait DualProtectedCommitStore {
    type Slot: ProtectedGenerationSlot;

    // Required methods
    fn slot0(&self) -> Option<&Self::Slot>;
    fn slot1(&self) -> Option<&Self::Slot>;

    // Provided methods
    fn is_uninitialized(&self) -> bool { ... }
    fn authoritative_slot(
        &self,
    ) -> Result<AuthoritativeSlot<'_, Self::Slot>, CommitRecoveryError> { ... }
    fn inactive_slot_index(&self) -> CommitSlotIndex { ... }
}
Expand description

DualProtectedCommitStore

Physical store with two protected generation slots.

This is an advanced low-level API for custom persistence/recovery integrations. Normal allocation flows recover and commit ledgers through the higher-level ledger commit APIs.

Required Associated Types§

Source

type Slot: ProtectedGenerationSlot

Protected slot record type.

Required Methods§

Source

fn slot0(&self) -> Option<&Self::Slot>

Borrow the first physical slot.

Source

fn slot1(&self) -> Option<&Self::Slot>

Borrow the second physical slot.

Provided Methods§

Source

fn is_uninitialized(&self) -> bool

Return true when no commit slot has ever been written.

Source

fn authoritative_slot( &self, ) -> Result<AuthoritativeSlot<'_, Self::Slot>, CommitRecoveryError>

Return the highest-generation valid physical slot.

Source

fn inactive_slot_index(&self) -> CommitSlotIndex

Return the slot that should receive the next staged generation write.

The result is derived from validated recovery state. It does not trust a separate current-pointer/header field.

Implementors§