pub struct AllocationLedger { /* private fields */ }Expand description
AllocationLedger
Durable ownership and current metadata, bounded by the usable memory-ID domain. Omitted and retired identities retain their slots; no per-upgrade or schema audit trail is stored.
The counter binds logical generations to physical commits. Decoded DTOs remain untrusted until integrity validation and protected recovery succeed.
Implementations§
Source§impl AllocationLedger
impl AllocationLedger
Sourcepub fn validate_integrity(&self) -> Result<(), LedgerIntegrityError>
pub fn validate_integrity(&self) -> Result<(), LedgerIntegrityError>
Validate count, unique ownership and empty genesis before recovery or commit. Checked field types already enforce key, slot and schema invariants.
Source§impl AllocationLedger
impl AllocationLedger
Sourcepub fn new(
current_generation: u64,
records: Vec<AllocationRecord>,
) -> Result<Self, LedgerIntegrityError>
pub fn new( current_generation: u64, records: Vec<AllocationRecord>, ) -> Result<Self, LedgerIntegrityError>
Build a ledger DTO after validating count, ownership and genesis rules. Recovery must still establish the persisted format and physical binding.
Sourcepub const fn current_generation(&self) -> u64
pub const fn current_generation(&self) -> u64
Return the current commit counter; this is not retained upgrade history.
Sourcepub fn records(&self) -> &[AllocationRecord]
pub fn records(&self) -> &[AllocationRecord]
Borrow retained ownership records, including omitted and retired stores.