pub struct InMemoryCheckpointer { /* private fields */ }Expand description
In-memory checkpointer for testing and short-lived graphs.
Data lives only as long as the process. For durable persistence, use the SurrealDB checkpointer from pe-memory.
Implementations§
Trait Implementations§
Source§impl Checkpointer for InMemoryCheckpointer
impl Checkpointer for InMemoryCheckpointer
Source§fn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
data: &'life3 [u8],
meta: &'life4 CheckpointMeta,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
data: &'life3 [u8],
meta: &'life4 CheckpointMeta,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Save a checkpoint. Returns nothing on success.
Source§fn load_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<u8>, CheckpointMeta)>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<u8>, CheckpointMeta)>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the most recent checkpoint for a thread.
Source§fn load_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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<CheckpointMeta>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointMeta>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all checkpoints for a thread, oldest first.
Source§fn put_writes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_thread_id: &'life1 str,
_checkpoint_id: &'life2 str,
_writes: &'life3 [PendingWrite],
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put_writes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_thread_id: &'life1 str,
_checkpoint_id: &'life2 str,
_writes: &'life3 [PendingWrite],
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store pending writes alongside a checkpoint. Read more
Source§impl Clone for InMemoryCheckpointer
impl Clone for InMemoryCheckpointer
Source§fn clone(&self) -> InMemoryCheckpointer
fn clone(&self) -> InMemoryCheckpointer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 InMemoryCheckpointer
impl Debug for InMemoryCheckpointer
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryCheckpointer
impl !UnwindSafe for InMemoryCheckpointer
impl Freeze for InMemoryCheckpointer
impl Send for InMemoryCheckpointer
impl Sync for InMemoryCheckpointer
impl Unpin for InMemoryCheckpointer
impl UnsafeUnpin for InMemoryCheckpointer
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