pub struct AllocationLedger {
pub ledger_schema_version: u32,
pub physical_format_id: u32,
pub current_generation: u64,
pub allocation_history: AllocationHistory,
}Expand description
AllocationLedger
Durable root of allocation history.
Fields§
§ledger_schema_version: u32Ledger schema version.
physical_format_id: u32Physical encoding format identifier.
current_generation: u64Current committed generation selected by recovery.
allocation_history: AllocationHistoryHistorical allocation facts.
Implementations§
Source§impl AllocationLedger
impl AllocationLedger
Sourcepub fn validate_integrity(&self) -> Result<(), LedgerIntegrityError>
pub fn validate_integrity(&self) -> Result<(), LedgerIntegrityError>
Validate structural ledger invariants before recovery or commit.
Sourcepub fn stage_validated_generation(
&self,
validated: &ValidatedAllocations,
committed_at: Option<u64>,
) -> Self
pub fn stage_validated_generation( &self, validated: &ValidatedAllocations, committed_at: Option<u64>, ) -> Self
Return a copy of the ledger with validated recorded as the next generation.
This is a pure logical update. Physical atomicity is the responsibility of the substrate commit protocol.
Sourcepub fn stage_reservation_generation(
&self,
reservations: &[AllocationDeclaration],
committed_at: Option<u64>,
) -> Result<Self, AllocationReservationError>
pub fn stage_reservation_generation( &self, reservations: &[AllocationDeclaration], committed_at: Option<u64>, ) -> Result<Self, AllocationReservationError>
Return a copy of the ledger with reservations recorded as the next generation.
This is a pure logical update. The caller is responsible for applying framework policy before staging reservations.
Sourcepub fn stage_retirement_generation(
&self,
retirement: &AllocationRetirement,
committed_at: Option<u64>,
) -> Result<Self, AllocationRetirementError>
pub fn stage_retirement_generation( &self, retirement: &AllocationRetirement, committed_at: Option<u64>, ) -> Result<Self, AllocationRetirementError>
Return a copy of the ledger with one explicit retirement committed.
Trait Implementations§
Source§impl Clone for AllocationLedger
impl Clone for AllocationLedger
Source§fn clone(&self) -> AllocationLedger
fn clone(&self) -> AllocationLedger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AllocationLedger
impl Debug for AllocationLedger
Source§impl<'de> Deserialize<'de> for AllocationLedger
impl<'de> Deserialize<'de> for AllocationLedger
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AllocationLedger
impl PartialEq for AllocationLedger
Source§fn eq(&self, other: &AllocationLedger) -> bool
fn eq(&self, other: &AllocationLedger) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AllocationLedger
impl Serialize for AllocationLedger
impl Eq for AllocationLedger
impl StructuralPartialEq for AllocationLedger
Auto Trait Implementations§
impl Freeze for AllocationLedger
impl RefUnwindSafe for AllocationLedger
impl Send for AllocationLedger
impl Sync for AllocationLedger
impl Unpin for AllocationLedger
impl UnsafeUnpin for AllocationLedger
impl UnwindSafe for AllocationLedger
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