pub struct AsyncRedisClient { /* private fields */ }
Expand description
Client that wraps a AsyncRedisConnection
.
Implementations§
Source§impl AsyncRedisClient
impl AsyncRedisClient
Sourcepub async fn cluster<'a>(
servers: impl IntoIterator<Item = &'a str>,
opts: &RedisConfigOptions,
) -> Result<Self, RedisError>
pub async fn cluster<'a>( servers: impl IntoIterator<Item = &'a str>, opts: &RedisConfigOptions, ) -> Result<Self, RedisError>
Creates a new AsyncRedisClient
in cluster mode.
Sourcepub async fn single(
server: &str,
opts: &RedisConfigOptions,
) -> Result<Self, RedisError>
pub async fn single( server: &str, opts: &RedisConfigOptions, ) -> Result<Self, RedisError>
Creates a new AsyncRedisClient
in single mode.
Sourcepub fn get_connection(&self) -> AsyncRedisConnection
pub fn get_connection(&self) -> AsyncRedisConnection
Returns a shared AsyncRedisConnection
.
Sourcepub fn stats(&self) -> Stats
pub fn stats(&self) -> Stats
Return Stats
for AsyncRedisClient
.
It will always return 0 for idle_connections
and 1 for connections
since we
are re-using the same connection.
Trait Implementations§
Source§impl Clone for AsyncRedisClient
impl Clone for AsyncRedisClient
Source§fn clone(&self) -> AsyncRedisClient
fn clone(&self) -> AsyncRedisClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AsyncRedisClient
impl !RefUnwindSafe for AsyncRedisClient
impl Send for AsyncRedisClient
impl Sync for AsyncRedisClient
impl Unpin for AsyncRedisClient
impl !UnwindSafe for AsyncRedisClient
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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