pub struct AllocationBootstrap<'store> { /* private fields */ }Expand description
AllocationBootstrap
Generic generation bootstrap pipeline.
This type owns allocation-governance sequencing only. Frameworks own when the pipeline runs, how the ledger store is backed by stable memory, and when endpoint dispatch is allowed.
Implementations§
Source§impl<'store> AllocationBootstrap<'store>
impl<'store> AllocationBootstrap<'store>
Sourcepub const fn new(store: &'store mut LedgerCommitStore) -> Self
pub const fn new(store: &'store mut LedgerCommitStore) -> Self
Build a bootstrap pipeline over a protected ledger commit store.
Sourcepub fn validate_and_commit<C, P>(
&mut self,
codec: &C,
snapshot: DeclarationSnapshot,
policy: &P,
committed_at: Option<u64>,
) -> Result<BootstrapCommit, BootstrapError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
pub fn validate_and_commit<C, P>(
&mut self,
codec: &C,
snapshot: DeclarationSnapshot,
policy: &P,
committed_at: Option<u64>,
) -> Result<BootstrapCommit, BootstrapError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
Recover, validate, stage, commit, and publish one allocation generation.
Sourcepub fn initialize_validate_and_commit<C, P>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
snapshot: DeclarationSnapshot,
policy: &P,
committed_at: Option<u64>,
) -> Result<BootstrapCommit, BootstrapError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
pub fn initialize_validate_and_commit<C, P>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
snapshot: DeclarationSnapshot,
policy: &P,
committed_at: Option<u64>,
) -> Result<BootstrapCommit, BootstrapError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
Initialize an empty ledger store explicitly, then validate and commit.
This is the generic genesis path. The supplied genesis ledger is a
framework decision; the generic crate only guarantees that it is used
when the protected physical store is empty, never when recovery sees
corrupt or partially written state.
Sourcepub fn reserve_and_commit<C, P>(
&mut self,
codec: &C,
reservations: &[AllocationDeclaration],
policy: &P,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapReservationError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
pub fn reserve_and_commit<C, P>(
&mut self,
codec: &C,
reservations: &[AllocationDeclaration],
policy: &P,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapReservationError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
Recover, policy-check, reserve, and commit one reservation generation.
Sourcepub fn initialize_reserve_and_commit<C, P>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
reservations: &[AllocationDeclaration],
policy: &P,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapReservationError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
pub fn initialize_reserve_and_commit<C, P>(
&mut self,
codec: &C,
genesis: &AllocationLedger,
reservations: &[AllocationDeclaration],
policy: &P,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapReservationError<C::Error, P::Error>>where
C: LedgerCodec,
P: AllocationPolicy,
Initialize an empty ledger store, then reserve and commit.
Sourcepub fn retire_and_commit<C>(
&mut self,
codec: &C,
retirement: &AllocationRetirement,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapRetirementError<C::Error>>where
C: LedgerCodec,
pub fn retire_and_commit<C>(
&mut self,
codec: &C,
retirement: &AllocationRetirement,
committed_at: Option<u64>,
) -> Result<AllocationLedger, BootstrapRetirementError<C::Error>>where
C: LedgerCodec,
Recover, retire, and commit one explicit retirement generation.