#[non_exhaustive]pub struct Checkpoint<S>{
pub id: CheckpointId,
pub tenant_id: TenantId,
pub thread_id: String,
pub parent_id: Option<CheckpointId>,
pub step: usize,
pub state: S,
pub next_node: Option<String>,
pub timestamp: DateTime<Utc>,
}Expand description
One snapshot of graph progress for a particular (tenant_id, thread_id). next_node = None indicates the graph terminated
cleanly (a finish point ran or a conditional edge routed to
END).
#[non_exhaustive] so post-1.0 additions (e.g. trace-context
propagation, schema-version stamping) ship as MINOR. Construct
via Checkpoint::new; attach the optional parent for
time-travel writes via Checkpoint::with_parent.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: CheckpointIdUnique identifier (UUID v7).
tenant_id: TenantIdTenant scope this checkpoint belongs to.
thread_id: StringConversation thread this checkpoint belongs to.
parent_id: Option<CheckpointId>Optional parent — used by time-travel writes.
step: usizeMonotonic step counter within the thread.
state: SState produced by the most recently executed node.
next_node: Option<String>Node the graph is poised to execute next, or None if it has
terminated.
timestamp: DateTime<Utc>When the checkpoint was written.
Implementations§
Source§impl<S> Checkpoint<S>
impl<S> Checkpoint<S>
Sourcepub fn new(
key: &ThreadKey,
step: usize,
state: S,
next_node: Option<String>,
) -> Self
pub fn new( key: &ThreadKey, step: usize, state: S, next_node: Option<String>, ) -> Self
Construct a fresh checkpoint addressed by key. Generates a
new CheckpointId (UUID v7) and stamps timestamp with
the current wall clock. parent_id defaults to None;
chain Self::with_parent for time-travel writes.
Sourcepub const fn with_parent(self, parent_id: CheckpointId) -> Self
pub const fn with_parent(self, parent_id: CheckpointId) -> Self
Attach a parent_id (time-travel branching). Chain after
Self::new.
Sourcepub fn from_parts(
id: CheckpointId,
key: &ThreadKey,
parent_id: Option<CheckpointId>,
step: usize,
state: S,
next_node: Option<String>,
timestamp: DateTime<Utc>,
) -> Self
pub fn from_parts( id: CheckpointId, key: &ThreadKey, parent_id: Option<CheckpointId>, step: usize, state: S, next_node: Option<String>, timestamp: DateTime<Utc>, ) -> Self
Reconstitute a checkpoint from explicit parts. Used by
persistence backends rehydrating rows from storage — the
caller already knows every field’s value (id from the row’s
PK, timestamp from the column). Agent code reaches for
Self::new instead.
Trait Implementations§
Source§impl<S> Clone for Checkpoint<S>
impl<S> Clone for Checkpoint<S>
Source§fn clone(&self) -> Checkpoint<S>
fn clone(&self) -> Checkpoint<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more