pub struct Checkpoint { /* private fields */ }Expand description
One committed, self-validating graph checkpoint.
The full checksum binds the validated write intent to the exact committed journal head. Restoring this value verifies state, intent, predecessor, and checkpoint integrity before any graph code may observe it.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn commit(
write: CheckpointWrite,
journal_head: JournalHead,
) -> Result<Self, CheckpointError>
pub fn commit( write: CheckpointWrite, journal_head: JournalHead, ) -> Result<Self, CheckpointError>
Materializes a checkpoint after its anchoring event has committed.
Stores must call this using the journal head produced inside the same transaction that inserts the checkpoint and advances the run head.
§Errors
Returns CheckpointError for a crossed journal scope, a journal head
that did not advance beyond the parent, clock regression, or integrity
serialization failure.
Sourcepub fn restore(
write: CheckpointWrite,
journal_head: JournalHead,
digest: Digest,
) -> Result<Self, CheckpointError>
pub fn restore( write: CheckpointWrite, journal_head: JournalHead, digest: Digest, ) -> Result<Self, CheckpointError>
Restores a full checkpoint and verifies its persisted checksum.
§Errors
Returns CheckpointError for any structural, chronology, scope, or
checksum mismatch.
Sourcepub const fn checkpoint_id(&self) -> CheckpointId
pub const fn checkpoint_id(&self) -> CheckpointId
Returns the 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 write-intent checksum.
Sourcepub const fn journal_head(&self) -> &JournalHead
pub const fn journal_head(&self) -> &JournalHead
Returns the exact journal prefix included in this checkpoint.
Sourcepub fn head(&self) -> CheckpointHead
pub fn head(&self) -> CheckpointHead
Returns a compact predecessor/head value for optimistic comparison.
Sourcepub fn matches_write(&self, write: &CheckpointWrite) -> bool
pub fn matches_write(&self, write: &CheckpointWrite) -> bool
Returns true when this checkpoint materialized the exact write intent.
Sourcepub fn write_intent(&self) -> CheckpointWrite
pub fn write_intent(&self) -> CheckpointWrite
Reconstructs the verified write intent that produced this checkpoint.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§impl Debug for Checkpoint
impl Debug for Checkpoint
Source§impl<'de> Deserialize<'de> for Checkpoint
impl<'de> Deserialize<'de> for Checkpoint
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 Checkpoint
Source§impl JsonSchema for Checkpoint
impl JsonSchema for Checkpoint
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