pub struct LedgerCommitStore {
pub physical: DualCommitStore,
}Expand description
LedgerCommitStore
Generation-scoped allocation ledger commit store.
This type owns the generic commit lifecycle. It deliberately does not own serialization or stable-memory IO; those remain substrate/integration responsibilities.
Fields§
§physical: DualCommitStoreProtected physical commit slots.
Implementations§
Source§impl LedgerCommitStore
impl LedgerCommitStore
Sourcepub fn recover<C: LedgerCodec>(
&self,
codec: &C,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn recover<C: LedgerCodec>( &self, codec: &C, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Recover the authoritative allocation ledger using codec.
Sourcepub fn recover_with_compatibility<C: LedgerCodec>(
&self,
codec: &C,
compatibility: LedgerCompatibility,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn recover_with_compatibility<C: LedgerCodec>( &self, codec: &C, compatibility: LedgerCompatibility, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Recover the authoritative allocation ledger using explicit compatibility rules.
Sourcepub fn recover_or_initialize<C: LedgerCodec>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn recover_or_initialize<C: LedgerCodec>( &mut self, codec: &C, genesis: &AllocationLedger, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Recover the authoritative ledger, or explicitly initialize an empty store.
Initialization is allowed only when no physical commit slot has ever been written. Corrupt or partially written stores fail closed even when a genesis ledger is supplied.
Sourcepub fn recover_or_initialize_with_compatibility<C: LedgerCodec>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
compatibility: LedgerCompatibility,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn recover_or_initialize_with_compatibility<C: LedgerCodec>( &mut self, codec: &C, genesis: &AllocationLedger, compatibility: LedgerCompatibility, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Recover the authoritative ledger, or initialize an empty store with explicit compatibility.
Sourcepub fn commit<C: LedgerCodec>(
&mut self,
ledger: &AllocationLedger,
codec: &C,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn commit<C: LedgerCodec>( &mut self, ledger: &AllocationLedger, codec: &C, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Commit one logical allocation ledger generation through codec.
Sourcepub fn commit_with_compatibility<C: LedgerCodec>(
&mut self,
ledger: &AllocationLedger,
codec: &C,
compatibility: LedgerCompatibility,
) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
pub fn commit_with_compatibility<C: LedgerCodec>( &mut self, ledger: &AllocationLedger, codec: &C, compatibility: LedgerCompatibility, ) -> Result<AllocationLedger, LedgerCommitError<C::Error>>
Commit one logical allocation ledger generation through explicit compatibility.
Sourcepub fn write_corrupt_inactive_ledger<C: LedgerCodec>(
&mut self,
ledger: &AllocationLedger,
codec: &C,
) -> Result<(), LedgerCommitError<C::Error>>
pub fn write_corrupt_inactive_ledger<C: LedgerCodec>( &mut self, ledger: &AllocationLedger, codec: &C, ) -> Result<(), LedgerCommitError<C::Error>>
Simulate a torn write of a logical ledger payload into the inactive slot.
Trait Implementations§
Source§impl Clone for LedgerCommitStore
impl Clone for LedgerCommitStore
Source§fn clone(&self) -> LedgerCommitStore
fn clone(&self) -> LedgerCommitStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LedgerCommitStore
impl Debug for LedgerCommitStore
Source§impl Default for LedgerCommitStore
impl Default for LedgerCommitStore
Source§fn default() -> LedgerCommitStore
fn default() -> LedgerCommitStore
Source§impl<'de> Deserialize<'de> for LedgerCommitStore
impl<'de> Deserialize<'de> for LedgerCommitStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LedgerCommitStore
impl PartialEq for LedgerCommitStore
Source§fn eq(&self, other: &LedgerCommitStore) -> bool
fn eq(&self, other: &LedgerCommitStore) -> bool
self and other values to be equal, and is used by ==.