pub struct LedgerCommitStore { /* private fields */ }Expand description
LedgerCommitStore
Generation-scoped allocation ledger commit store.
This type owns the logical commit lifecycle and the crate-owned CBOR ledger encoding. It deliberately does not own stable-memory IO; that remains the substrate or framework owner’s responsibility.
This store commits allocation ledger generations. It does not open stable-memory handles and does not allocate application slots.
Implementations§
Source§impl LedgerCommitStore
impl LedgerCommitStore
Sourcepub const fn physical(&self) -> &DualCommitStore
pub const fn physical(&self) -> &DualCommitStore
Borrow the protected physical commit store for diagnostics.
Sourcepub fn recover(&self) -> Result<RecoveredLedger, LedgerCommitError>
pub fn recover(&self) -> Result<RecoveredLedger, LedgerCommitError>
Recover the authoritative allocation ledger using the native CBOR ledger codec.
Sourcepub fn recover_or_initialize(
&mut self,
genesis: &AllocationLedger,
) -> Result<RecoveredLedger, LedgerCommitError>
pub fn recover_or_initialize( &mut self, genesis: &AllocationLedger, ) -> Result<RecoveredLedger, LedgerCommitError>
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 commit(
&mut self,
ledger: &AllocationLedger,
) -> Result<RecoveredLedger, LedgerCommitError>
pub fn commit( &mut self, ledger: &AllocationLedger, ) -> Result<RecoveredLedger, LedgerCommitError>
Commit one logical allocation ledger generation through the native CBOR ledger codec.
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 ==.