pub struct InMemoryPersistence<State, End> { /* private fields */ }Expand description
In-memory state persistence.
Implementations§
Source§impl<State, End> InMemoryPersistence<State, End>
impl<State, End> InMemoryPersistence<State, End>
Sourcepub fn state_count(&self) -> usize
pub fn state_count(&self) -> usize
Get the number of stored states.
Sourcepub fn result_count(&self) -> usize
pub fn result_count(&self) -> usize
Get the number of stored results.
Trait Implementations§
Source§impl<State: Clone, End: Clone> Clone for InMemoryPersistence<State, End>
impl<State: Clone, End: Clone> Clone for InMemoryPersistence<State, End>
Source§fn clone(&self) -> InMemoryPersistence<State, End>
fn clone(&self) -> InMemoryPersistence<State, End>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<State, End> Default for InMemoryPersistence<State, End>
impl<State, End> Default for InMemoryPersistence<State, End>
Source§impl<State, End> StatePersistence<State, End> for InMemoryPersistence<State, End>
impl<State, End> StatePersistence<State, End> for InMemoryPersistence<State, End>
Source§fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
state: &'life2 State,
step: u32,
) -> Pin<Box<dyn Future<Output = Result<(), PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
state: &'life2 State,
step: u32,
) -> Pin<Box<dyn Future<Output = Result<(), PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save state for a run.
Source§fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(State, u32)>, PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(State, u32)>, PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load state for a run.
Source§fn save_result<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
result: &'life2 End,
) -> Pin<Box<dyn Future<Output = Result<(), PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_result<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
result: &'life2 End,
) -> Pin<Box<dyn Future<Output = Result<(), PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save the final result.
Source§fn load_result<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<End>, PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_result<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<End>, PersistenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the final result.
Auto Trait Implementations§
impl<State, End> Freeze for InMemoryPersistence<State, End>
impl<State, End> !RefUnwindSafe for InMemoryPersistence<State, End>
impl<State, End> Send for InMemoryPersistence<State, End>
impl<State, End> Sync for InMemoryPersistence<State, End>
impl<State, End> Unpin for InMemoryPersistence<State, End>
impl<State, End> !UnwindSafe for InMemoryPersistence<State, End>
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