pub struct RedisConnection { /* private fields */ }Expand description
A wrapper type for making the redis crate compatible with namespacing.
Implementations§
Source§impl RedisConnection
impl RedisConnection
pub fn new(connection: Connection) -> Self
pub fn set_namespace(&mut self, namespace: String)
pub fn with_namespace(self, namespace: String) -> Self
Sourcepub fn unnamespaced_borrow_mut(&mut self) -> &mut Connection
pub fn unnamespaced_borrow_mut(&mut self) -> &mut Connection
This allows you to borrow the raw redis connection without any namespacing support.
pub async fn brpop( &mut self, keys: Vec<String>, timeout: usize, ) -> Result<Option<(String, String)>, RedisError>
pub fn cmd_with_key(&mut self, cmd: &str, key: String) -> Cmd
pub async fn del(&mut self, key: String) -> Result<usize, RedisError>
pub async fn expire( &mut self, key: String, value: usize, ) -> Result<usize, RedisError>
pub async fn lpush<V>( &mut self, key: String, value: V, ) -> Result<(), RedisError>
pub async fn sadd<V>(&mut self, key: String, value: V) -> Result<(), RedisError>
pub async fn set_nx_ex<V>( &mut self, key: String, value: V, ttl_in_seconds: usize, ) -> Result<RedisValue, RedisError>
pub async fn zrange( &mut self, key: String, lower: isize, upper: isize, ) -> Result<Vec<String>, RedisError>
pub async fn zrangebyscore_limit<L: ToSingleRedisArg + Send + Sync, U: ToSingleRedisArg + Sync + Send>( &mut self, key: String, lower: L, upper: U, offset: isize, limit: isize, ) -> Result<Vec<String>, RedisError>
pub async fn zadd<V: ToSingleRedisArg + Send + Sync, S: ToSingleRedisArg + Send + Sync>( &mut self, key: String, value: V, score: S, ) -> Result<usize, RedisError>
pub async fn zadd_ch<V: ToRedisArgs + Send + Sync, S: ToRedisArgs + Send + Sync>( &mut self, key: String, value: V, score: S, ) -> Result<bool, RedisError>
pub async fn zrem<V>( &mut self, key: String, value: V, ) -> Result<usize, RedisError>
Auto Trait Implementations§
impl Freeze for RedisConnection
impl RefUnwindSafe for RedisConnection
impl Send for RedisConnection
impl Sync for RedisConnection
impl Unpin for RedisConnection
impl UnsafeUnpin for RedisConnection
impl UnwindSafe for RedisConnection
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