Checkpointer

Trait Checkpointer 

Source
pub trait Checkpointer: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        checkpoint: &'life1 Checkpoint,
    ) -> Pin<Box<dyn Future<Output = Result<String, GraphError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, GraphError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn load_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        checkpoint_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, GraphError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>, GraphError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Available on crate feature graph only.
Expand description

Checkpointer trait for persistence

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, checkpoint: &'life1 Checkpoint, ) -> Pin<Box<dyn Future<Output = Result<String, GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Save a checkpoint

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Load the latest checkpoint for a thread

Source

fn load_by_id<'life0, 'life1, 'async_trait>( &'life0 self, checkpoint_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Load a specific checkpoint by ID

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>, GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

List all checkpoints for a thread (for time travel)

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Delete checkpoints for a thread

Implementors§