pub trait PocketIcBaselineRecipe:
Send
+ Sync
+ 'static {
type Metadata: Send + 'static;
type Error: Error + Send + Sync + 'static;
// Required methods
fn reset_requirements(&self) -> &ResetRequirements;
fn build(
&self,
) -> Result<CachedPocketIcBaseline<Self::Metadata>, Self::Error>;
fn reset_non_snapshot_state(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<ResetReceipt, Self::Error>;
fn drive_to_readiness(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<(), Self::Error>;
fn validate(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
preparation: &PreparedBaseline,
) -> Result<(), Self::Error>;
// Provided methods
fn prepare_restore(
&self,
_baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<(), Self::Error> { ... }
fn classify_failure(
&self,
stage: BaselinePreparationStage,
_error: &(dyn Error + 'static),
) -> FailureDisposition { ... }
}Expand description
Caller-owned build, preflight and non-snapshot reset policy for one pooled baseline.
Required Associated Types§
Required Methods§
Sourcefn reset_requirements(&self) -> &ResetRequirements
fn reset_requirements(&self) -> &ResetRequirements
Reset guarantees required before an existing slot may be reused.
Sourcefn build(&self) -> Result<CachedPocketIcBaseline<Self::Metadata>, Self::Error>
fn build(&self) -> Result<CachedPocketIcBaseline<Self::Metadata>, Self::Error>
Construct and capture one complete baseline.
Sourcefn reset_non_snapshot_state(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<ResetReceipt, Self::Error>
fn reset_non_snapshot_state( &self, baseline: &CachedPocketIcBaseline<Self::Metadata>, ) -> Result<ResetReceipt, Self::Error>
Reset state not covered by canister snapshots.
Sourcefn drive_to_readiness(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<(), Self::Error>
fn drive_to_readiness( &self, baseline: &CachedPocketIcBaseline<Self::Metadata>, ) -> Result<(), Self::Error>
Drive the topology to the recipe’s readiness boundary. Successful completion permits final invariant validation.
Sourcefn validate(
&self,
baseline: &CachedPocketIcBaseline<Self::Metadata>,
preparation: &PreparedBaseline,
) -> Result<(), Self::Error>
fn validate( &self, baseline: &CachedPocketIcBaseline<Self::Metadata>, preparation: &PreparedBaseline, ) -> Result<(), Self::Error>
Validate the same baseline invariants after build and restore. Success admits this pool-owned recipe’s baseline for leasing.
Provided Methods§
Sourcefn prepare_restore(
&self,
_baseline: &CachedPocketIcBaseline<Self::Metadata>,
) -> Result<(), Self::Error>
fn prepare_restore( &self, _baseline: &CachedPocketIcBaseline<Self::Metadata>, ) -> Result<(), Self::Error>
Admit recipe-specific preconditions before the pool restores snapshots.
Most recipes need no preflight. Checks such as exact current cycle-balance guards run here, before restoration can charge cycles. This cannot replace the pool’s canonical restore or manufacture its completion evidence.
Sourcefn classify_failure(
&self,
stage: BaselinePreparationStage,
_error: &(dyn Error + 'static),
) -> FailureDisposition
fn classify_failure( &self, stage: BaselinePreparationStage, _error: &(dyn Error + 'static), ) -> FailureDisposition
Classify a restored-slot recipe failure as fatal or rebuildable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".