pub struct CheckpointWrite { /* private fields */ }Expand description
Stable checkpoint write intent before the anchoring journal event commits.
The intent checksum is the idempotency fingerprint for checkpoint storage. It deliberately excludes the future journal head while binding every caller-controlled field and the exact predecessor.
Implementations§
Source§impl CheckpointWrite
impl CheckpointWrite
Sourcepub fn initial(
tenant_id: TenantId,
run_id: RunId,
checkpoint_id: CheckpointId,
graph: GraphReference,
state: CheckpointState,
ready_nodes: ReadyNodes,
) -> Result<Self, CheckpointWriteError>
pub fn initial( tenant_id: TenantId, run_id: RunId, checkpoint_id: CheckpointId, graph: GraphReference, state: CheckpointState, ready_nodes: ReadyNodes, ) -> Result<Self, CheckpointWriteError>
Constructs the initial superstep-zero checkpoint intent.
§Errors
Returns CheckpointWriteError when the state schema differs from the
graph reference or integrity serialization fails.
Sourcepub fn successor(
checkpoint_id: CheckpointId,
parent: &Checkpoint,
state: CheckpointState,
ready_nodes: ReadyNodes,
) -> Result<Self, CheckpointWriteError>
pub fn successor( checkpoint_id: CheckpointId, parent: &Checkpoint, state: CheckpointState, ready_nodes: ReadyNodes, ) -> Result<Self, CheckpointWriteError>
Constructs the exact successor of a validated committed checkpoint.
The graph reference and scope are inherited rather than accepted from the caller, preventing a recovery chain from silently switching graph code or tenant identity.
§Errors
Returns CheckpointWriteError for position exhaustion, a reused
checkpoint ID, a mismatched state schema, or integrity failure.
Sourcepub fn restore(
tenant_id: TenantId,
run_id: RunId,
checkpoint_id: CheckpointId,
superstep: Superstep,
graph: GraphReference,
state: CheckpointState,
ready_nodes: ReadyNodes,
parent: Option<CheckpointHead>,
intent_digest: Digest,
) -> Result<Self, CheckpointWriteError>
pub fn restore( tenant_id: TenantId, run_id: RunId, checkpoint_id: CheckpointId, superstep: Superstep, graph: GraphReference, state: CheckpointState, ready_nodes: ReadyNodes, parent: Option<CheckpointHead>, intent_digest: Digest, ) -> Result<Self, CheckpointWriteError>
Restores a write intent from durable columns and verifies its checksum.
This constructor exists for storage providers that map fields to typed columns instead of round-tripping the public JSON envelope.
§Errors
Returns CheckpointWriteError for any invalid initial/successor
shape, crossed scope, graph/schema mismatch, or checksum mismatch.
Sourcepub const fn checkpoint_id(&self) -> CheckpointId
pub const fn checkpoint_id(&self) -> CheckpointId
Returns the new immutable checkpoint identity.
Sourcepub const fn graph(&self) -> &GraphReference
pub const fn graph(&self) -> &GraphReference
Returns the exact graph definition reference.
Sourcepub const fn state(&self) -> &CheckpointState
pub const fn state(&self) -> &CheckpointState
Returns the immutable graph state.
Sourcepub const fn ready_nodes(&self) -> &ReadyNodes
pub const fn ready_nodes(&self) -> &ReadyNodes
Returns the sorted next-superstep ready set.
Sourcepub const fn parent(&self) -> Option<&CheckpointHead>
pub const fn parent(&self) -> Option<&CheckpointHead>
Returns the exact predecessor, absent only at superstep zero.
Sourcepub const fn intent_digest(&self) -> Digest
pub const fn intent_digest(&self) -> Digest
Returns the stable idempotency checksum for this write.
Trait Implementations§
Source§impl Clone for CheckpointWrite
impl Clone for CheckpointWrite
Source§impl Debug for CheckpointWrite
impl Debug for CheckpointWrite
Source§impl<'de> Deserialize<'de> for CheckpointWrite
impl<'de> Deserialize<'de> for CheckpointWrite
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>,
impl Eq for CheckpointWrite
Source§impl JsonSchema for CheckpointWrite
impl JsonSchema for CheckpointWrite
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more