pub struct InMemory { /* private fields */ }Expand description
In-memory store backed by Mutex<Vec<(String, String)>>.
Implementations§
Trait Implementations§
Source§impl Memory for InMemory
impl Memory for InMemory
Source§fn set(
&self,
key: impl Into<String>,
value: impl Into<String>,
) -> Option<String>
fn set( &self, key: impl Into<String>, value: impl Into<String>, ) -> Option<String>
Set (upsert) a key-value pair. Returns the previous value if the key existed.
Source§fn remove(&self, key: &str) -> Option<String>
fn remove(&self, key: &str) -> Option<String>
Remove a key. Returns the removed value if it existed.
Source§fn store(
&self,
key: impl Into<String> + Send,
value: impl Into<String> + Send,
) -> impl Future<Output = Result<(), Error>> + Send
fn store( &self, key: impl Into<String> + Send, value: impl Into<String> + Send, ) -> impl Future<Output = Result<(), Error>> + Send
Store a key-value pair (async). Default delegates to
set.Auto Trait Implementations§
impl !Freeze for InMemory
impl RefUnwindSafe for InMemory
impl Send for InMemory
impl Sync for InMemory
impl Unpin for InMemory
impl UnsafeUnpin for InMemory
impl UnwindSafe for InMemory
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