langgraph_checkpoint/
traits.rs1use thiserror::Error;
2
3use crate::types::Checkpoint;
4
5#[derive(Debug, Error)]
6pub enum CheckpointError {
7 #[error("checkpoint conflict: `{0}`")]
8 Conflict(String),
9 #[error("storage error: {0}")]
10 Storage(String),
11}
12
13pub trait CheckpointSaver: Send + Sync {
14 fn put(&self, checkpoint: Checkpoint) -> Result<(), CheckpointError>;
15 fn get(
16 &self,
17 thread_id: &str,
18 checkpoint_id: &str,
19 ) -> Result<Option<Checkpoint>, CheckpointError>;
20 fn list(&self, thread_id: &str) -> Result<Vec<Checkpoint>, CheckpointError>;
24}