pub struct MemorySaver { /* private fields */ }Expand description
In-memory checkpoint storage
Thread-safe checkpoint storage using in-memory data structures. Data is lost when the process exits. Suitable for development and testing.
Implementations§
Source§impl MemorySaver
impl MemorySaver
Sourcepub fn with_ttl_config(self, ttl_config: TtlConfig) -> Self
pub fn with_ttl_config(self, ttl_config: TtlConfig) -> Self
Create a new in-memory saver with TTL configuration (M04-001)
§Arguments
ttl_config- TTL configuration for automatic checkpoint expiration
Sourcepub fn ttl_config(&self) -> TtlConfig
pub fn ttl_config(&self) -> TtlConfig
Get the current TTL configuration
Returns a clone of the current TTL configuration.
§Panics
Panics if the internal RwLock is poisoned (indicating a writer thread
panicked while holding the write lock).
Sourcepub fn set_ttl_config(&self, ttl_config: TtlConfig)
pub fn set_ttl_config(&self, ttl_config: TtlConfig)
Trait Implementations§
Source§impl CheckpointSaver for MemorySaver
impl CheckpointSaver for MemorySaver
Source§fn get_tuple<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointTuple>, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tuple<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointTuple>, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get checkpoint tuple by configuration Read more
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
filter: Option<CheckpointFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointTuple>, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
filter: Option<CheckpointFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointTuple>, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List checkpoints with optional filtering Read more
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> Pin<Box<dyn Future<Output = Result<RunnableConfig, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> Pin<Box<dyn Future<Output = Result<RunnableConfig, CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a checkpoint Read more
Source§fn put_writes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
writes: Vec<PendingWrite>,
task_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_writes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
writes: Vec<PendingWrite>,
task_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CoreCheckpointError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save incremental writes from a completed task Read more
Source§impl Clone for MemorySaver
impl Clone for MemorySaver
Source§fn clone(&self) -> MemorySaver
fn clone(&self) -> MemorySaver
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 MemorySaver
impl Debug for MemorySaver
Auto Trait Implementations§
impl !RefUnwindSafe for MemorySaver
impl !UnwindSafe for MemorySaver
impl Freeze for MemorySaver
impl Send for MemorySaver
impl Sync for MemorySaver
impl Unpin for MemorySaver
impl UnsafeUnpin for MemorySaver
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