pub struct MemoryStorage { /* private fields */ }Expand description
In-memory storage backend using DashMap.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§impl Storage for MemoryStorage
impl Storage for MemoryStorage
Source§fn get(&self, key: &[u8]) -> BoxFuture<'_, Result<Option<Vec<u8>>, Error>>
fn get(&self, key: &[u8]) -> BoxFuture<'_, Result<Option<Vec<u8>>, Error>>
Get a value by key. Returns
None if the key does not exist.Source§fn set(&self, key: &[u8], value: Vec<u8>) -> BoxFuture<'_, Result<(), Error>>
fn set(&self, key: &[u8], value: Vec<u8>) -> BoxFuture<'_, Result<(), Error>>
Set a key to a value, overwriting any existing value.
Source§fn increment(&self, key: &[u8], delta: i64) -> BoxFuture<'_, Result<i64, Error>>
fn increment(&self, key: &[u8], delta: i64) -> BoxFuture<'_, Result<i64, Error>>
Atomically increment a counter by
delta, returning the new value.
If the key does not exist, it is created with an initial value of delta.Auto Trait Implementations§
impl Freeze for MemoryStorage
impl !RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnsafeUnpin for MemoryStorage
impl UnwindSafe for MemoryStorage
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