pub trait RestartStateComponent<CaptureCtx, RestoreCtx, Command, Digest> {
type Snapshot;
const NAME: RestartComponentName;
// Required methods
fn capture(ctx: &CaptureCtx) -> Self::Snapshot;
fn restore(ctx: &mut RestoreCtx, snapshot: &Self::Snapshot);
fn digest(ctx: &CaptureCtx) -> Digest;
fn replay(command: &Command, ctx: &mut RestoreCtx) -> ReplayDisposition;
fn mutation_sources() -> &'static [MutationSource];
// Provided method
fn descriptor() -> RestartComponentDescriptor { ... }
}Expand description
Contract every restart-owned component must implement.
The concrete engine state and command types still live outside this crate. Capture and restore contexts are intentionally separate because snapshot capture often needs a durable boundary while restore mutates engine state.
Required Associated Constants§
const NAME: RestartComponentName
Required Associated Types§
Required Methods§
fn capture(ctx: &CaptureCtx) -> Self::Snapshot
fn restore(ctx: &mut RestoreCtx, snapshot: &Self::Snapshot)
fn digest(ctx: &CaptureCtx) -> Digest
fn replay(command: &Command, ctx: &mut RestoreCtx) -> ReplayDisposition
fn mutation_sources() -> &'static [MutationSource]
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.