pub struct InMemoryCheckpointer { /* private fields */ }Expand description
In-memory checkpointer: thread-safe (all operations take a single mutex over the store), lost on restart. Suitable for development, tests, and ephemeral runs.
Implementations§
Trait Implementations§
Source§impl Checkpointer for InMemoryCheckpointer
impl Checkpointer for InMemoryCheckpointer
Source§fn put<'life0, 'async_trait>(
&'life0 self,
checkpoint: Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
checkpoint: Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist a checkpoint. Implementations must not overwrite an existing
checkpoint with the same id (ids are unique by construction). Read more
Source§fn get_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The most recent checkpoint for a thread, or
None if the thread has
never been checkpointed. Recency is defined by insertion (put)
order — the last successfully stored checkpoint wins — not by
super-step number: replay on the same thread legitimately appends
checkpoints whose step is at or below the existing head, and a
later resume must continue that newest timeline. Read moreSource§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>>> + 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<Checkpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
All checkpoints for a thread, oldest first (time-travel listing). Read more
Source§fn get_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch one specific checkpoint of a thread by id (time-travel handle). Read more
Source§fn fork_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
src_thread: &'life1 str,
dst_thread: &'life2 str,
at_checkpoint_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn fork_thread<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
src_thread: &'life1 str,
dst_thread: &'life2 str,
at_checkpoint_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Fork a thread’s history into a new thread (time travel). Read more
Source§impl Clone for InMemoryCheckpointer
impl Clone for InMemoryCheckpointer
Source§impl Debug for InMemoryCheckpointer
impl Debug for InMemoryCheckpointer
Auto Trait Implementations§
impl Freeze for InMemoryCheckpointer
impl RefUnwindSafe for InMemoryCheckpointer
impl Send for InMemoryCheckpointer
impl Sync for InMemoryCheckpointer
impl Unpin for InMemoryCheckpointer
impl UnsafeUnpin for InMemoryCheckpointer
impl UnwindSafe 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