pub struct InMemoryCheckpointer<S: GraphState + Clone> { /* private fields */ }Expand description
Stores (run_id, namespace, step) -> S in a Mutex-protected HashMap.
State must be Clone because saving stores a clone and loading returns one.
Implementations§
Source§impl<S: GraphState + Clone> InMemoryCheckpointer<S>
impl<S: GraphState + Clone> InMemoryCheckpointer<S>
Trait Implementations§
Source§impl<S: GraphState + Clone> Checkpointer<S> for InMemoryCheckpointer<S>
impl<S: GraphState + Clone> Checkpointer<S> for InMemoryCheckpointer<S>
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: u64,
state: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: u64,
state: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save state at
step for run_id.Source§fn load<'life0, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load state for
run_id at step (or the latest if step is None).Source§fn list<'life0, 'async_trait>(
&'life0 self,
run_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
run_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all saved step numbers for
run_id.Source§fn save_active<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: u64,
active: &'life1 [ActiveSnapshot],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_active<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: Uuid,
step: u64,
active: &'life1 [ActiveSnapshot],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save the engine’s active task snapshot alongside state. Default
is no-op — older checkpointers won’t persist the active set, and
engine::resume falls back to the start node when load_active
returns empty.Source§impl<S: GraphState + Clone> Default for InMemoryCheckpointer<S>
impl<S: GraphState + Clone> Default for InMemoryCheckpointer<S>
Auto Trait Implementations§
impl<S> !Freeze for InMemoryCheckpointer<S>
impl<S> RefUnwindSafe for InMemoryCheckpointer<S>
impl<S> Send for InMemoryCheckpointer<S>
impl<S> Sync for InMemoryCheckpointer<S>
impl<S> Unpin for InMemoryCheckpointer<S>where
S: Unpin,
impl<S> UnsafeUnpin for InMemoryCheckpointer<S>
impl<S> UnwindSafe for InMemoryCheckpointer<S>
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