pub struct Checkpoint {
pub id: String,
pub state: Value,
pub next_node: Option<String>,
pub parent_id: Option<String>,
pub metadata: HashMap<String, Value>,
}Expand description
A snapshot of graph state at a point in execution.
Fields§
§id: StringUnique identifier for this checkpoint.
state: ValueSerialized graph state.
next_node: Option<String>The next node to execute (or None if graph completed).
parent_id: Option<String>ID of the previous checkpoint (for traversing history).
metadata: HashMap<String, Value>Metadata about this checkpoint (node name, timestamp, etc.).
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn new(state: Value, next_node: Option<String>) -> Self
pub fn new(state: Value, next_node: Option<String>) -> Self
Create a new checkpoint with auto-generated ID.
Sourcepub fn with_parent(self, parent_id: impl Into<String>) -> Self
pub fn with_parent(self, parent_id: impl Into<String>) -> Self
Set the parent checkpoint ID.
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata to the checkpoint.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more