pub trait StoreMut: Store {
// Required method
fn update(
&mut self,
key: Self::Key,
value: Self::Value,
) -> impl Future<Output = Result<(), Self::Error>>;
// Provided methods
fn upsert(
&mut self,
key: Self::Key,
update: impl FnOnce(&mut Self::Value),
) -> impl Future<Output = Result<(), Self::Error>>
where Self::Value: Default { ... }
fn create(
&mut self,
key: Self::Key,
value: Self::Value,
) -> impl Future<Output = Result<bool, Self::Error>> { ... }
}Expand description
A mutable key-value store.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.