pub struct RedisClient {
pub redis_conn_pool: Pool,
}Expand description
Wrapper for pooled Redis client.
Fields§
§redis_conn_pool: PoolPooled Redis client.
Implementations§
Source§impl RedisClient
impl RedisClient
Sourcepub fn new(url: impl AsRef<str>) -> RedisResult<Self>
pub fn new(url: impl AsRef<str>) -> RedisResult<Self>
Create a new Redis client from connect url.
Sourcepub async fn get_conn(&self) -> Connection
pub async fn get_conn(&self) -> Connection
Get a connection from the pool.
Trait Implementations§
Source§impl Clone for RedisClient
impl Clone for RedisClient
Source§fn clone(&self) -> RedisClient
fn clone(&self) -> RedisClient
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 Debug for RedisClient
impl Debug for RedisClient
Auto Trait Implementations§
impl !RefUnwindSafe for RedisClient
impl !UnwindSafe for RedisClient
impl Freeze for RedisClient
impl Send for RedisClient
impl Sync for RedisClient
impl Unpin for RedisClient
impl UnsafeUnpin for RedisClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more