pub struct StoreCheckpointer { /* private fields */ }Expand description
Checkpointer implementation backed by any Store.
Checkpoints are stored under namespace ["checkpoints", "{thread_id}"]
with the checkpoint ID as the key.
This replaces MemorySaver (in-memory only) and FileSaver (file-only)
with a single implementation that works with any Store backend.
Implementations§
Trait Implementations§
Source§impl Checkpointer for StoreCheckpointer
impl Checkpointer for StoreCheckpointer
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
checkpoint: &'life2 Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
checkpoint: &'life2 Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save a checkpoint for the given thread.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a checkpoint. If
config.checkpoint_id is set, returns that specific
checkpoint; otherwise returns the latest checkpoint for the thread.Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 CheckpointConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all checkpoints for a thread, ordered oldest to newest.
Auto Trait Implementations§
impl Freeze for StoreCheckpointer
impl !RefUnwindSafe for StoreCheckpointer
impl Send for StoreCheckpointer
impl Sync for StoreCheckpointer
impl Unpin for StoreCheckpointer
impl UnsafeUnpin for StoreCheckpointer
impl !UnwindSafe for StoreCheckpointer
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