Struct ockam_node::storage::InMemoryValueStorage
source · pub struct InMemoryValueStorage<V> { /* private fields */ }Expand description
In memory implementation of a value storage
Implementations§
source§impl<V: Default> InMemoryValueStorage<V>
impl<V: Default> InMemoryValueStorage<V>
Default in-memory value storage, starting with a default value for V
sourcepub fn create() -> InMemoryValueStorage<V>
pub fn create() -> InMemoryValueStorage<V>
Create a new in-memory value storage
Trait Implementations§
source§impl<V: Send + Sync + Clone + 'static> ValueStorage<V> for InMemoryValueStorage<V>
impl<V: Send + Sync + Clone + 'static> ValueStorage<V> for InMemoryValueStorage<V>
Trait implementation for ValueStorage
source§fn update_value<'life0, 'async_trait>(
&'life0 self,
f: impl 'async_trait + Fn(V) -> Result<V> + Send + Sync + 'static
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_value<'life0, 'async_trait>( &'life0 self, f: impl 'async_trait + Fn(V) -> Result<V> + Send + Sync + 'static ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Update the currently stored value
source§fn modify_value<'life0, 'async_trait, R>(
&'life0 self,
f: impl 'async_trait + Fn(V) -> Result<(V, R)> + Send + Sync + 'static
) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where
R: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn modify_value<'life0, 'async_trait, R>( &'life0 self, f: impl 'async_trait + Fn(V) -> Result<(V, R)> + Send + Sync + 'static ) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where R: 'async_trait, Self: 'async_trait, 'life0: 'async_trait,
Update the currently stored value and return a result R
source§fn read_value<'life0, 'async_trait, R>(
&'life0 self,
f: impl 'async_trait + Fn(V) -> Result<R> + Send + Sync + 'static
) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where
R: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn read_value<'life0, 'async_trait, R>( &'life0 self, f: impl 'async_trait + Fn(V) -> Result<R> + Send + Sync + 'static ) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where R: 'async_trait, Self: 'async_trait, 'life0: 'async_trait,
Read the currently stored value and either return the full value or a subset of it, as R
Auto Trait Implementations§
impl<V> RefUnwindSafe for InMemoryValueStorage<V>
impl<V> Send for InMemoryValueStorage<V>where V: Send + Sync,
impl<V> Sync for InMemoryValueStorage<V>where V: Send + Sync,
impl<V> Unpin for InMemoryValueStorage<V>
impl<V> UnwindSafe for InMemoryValueStorage<V>
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