pub struct InMemoryStateStore { /* private fields */ }Expand description
A simple in-memory implementation of StateStore for testing.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryStateStore
impl Default for InMemoryStateStore
Source§impl StateStore for InMemoryStateStore
impl StateStore for InMemoryStateStore
Source§fn save_state<'life0, 'life1, 'async_trait, T>(
&'life0 self,
node_id: NodeId,
state: &'life1 T,
) -> Pin<Box<dyn Future<Output = Result<(), FloxideError>> + Send + 'async_trait>>
fn save_state<'life0, 'life1, 'async_trait, T>( &'life0 self, node_id: NodeId, state: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<(), FloxideError>> + Send + 'async_trait>>
Save a node’s state
Source§fn get_state<'life0, 'async_trait, T>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, FloxideError>> + Send + 'async_trait>>where
T: 'async_trait + for<'de> Deserialize<'de> + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn get_state<'life0, 'async_trait, T>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, FloxideError>> + Send + 'async_trait>>where
T: 'async_trait + for<'de> Deserialize<'de> + Send + Sync + 'static,
Self: 'async_trait,
'life0: 'async_trait,
Get a node’s state if it exists
Source§fn has_state<'life0, 'async_trait>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = Result<bool, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_state<'life0, 'async_trait>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = Result<bool, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a node has saved state
Auto Trait Implementations§
impl Freeze for InMemoryStateStore
impl RefUnwindSafe for InMemoryStateStore
impl Send for InMemoryStateStore
impl Sync for InMemoryStateStore
impl Unpin for InMemoryStateStore
impl UnsafeUnpin for InMemoryStateStore
impl UnwindSafe for InMemoryStateStore
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