pub struct RedisKvStore<C> { /* private fields */ }Expand description
A KvStore in Redis.
C is the connection the commands go over: a
redis::aio::ConnectionManager, which reconnects by itself, or a
redis::aio::MultiplexedConnection. It is cloned for each command, which
for both is a handle on one shared connection.
Implementations§
Trait Implementations§
Source§impl<C: Clone> Clone for RedisKvStore<C>
impl<C: Clone> Clone for RedisKvStore<C>
Source§fn clone(&self) -> RedisKvStore<C>
fn clone(&self) -> RedisKvStore<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C> Debug for RedisKvStore<C>
impl<C> Debug for RedisKvStore<C>
Source§impl<C> KvStore for RedisKvStore<C>
impl<C> KvStore for RedisKvStore<C>
Source§async fn set(
&self,
key: &[&str],
value: Value,
ttl: Option<Duration>,
) -> Result<(), KvError>
async fn set( &self, key: &[&str], value: Value, ttl: Option<Duration>, ) -> Result<(), KvError>
Put
value under key, replacing what was there, to expire after
ttl if given.Source§async fn insert(
&self,
key: &[&str],
value: Value,
ttl: Option<Duration>,
) -> Result<bool, KvError>
async fn insert( &self, key: &[&str], value: Value, ttl: Option<Duration>, ) -> Result<bool, KvError>
Put
value under key only if nothing is there, and say whether it
was put. Of any number of callers at once, in any number of
processes, exactly one is told it was: this is what makes “has this
activity been processed?” safe to ask from two workers.Auto Trait Implementations§
impl<C> Freeze for RedisKvStore<C>where
C: Freeze,
impl<C> RefUnwindSafe for RedisKvStore<C>where
C: RefUnwindSafe,
impl<C> Send for RedisKvStore<C>where
C: Send,
impl<C> Sync for RedisKvStore<C>where
C: Sync,
impl<C> Unpin for RedisKvStore<C>where
C: Unpin,
impl<C> UnsafeUnpin for RedisKvStore<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for RedisKvStore<C>where
C: UnwindSafe,
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