pub enum PooledClient {
Cluster(Box<PooledConnection<ClusterClient>>, RedisConfigOptions),
MultiWrite {
primary: Box<PooledClient>,
secondaries: Vec<PooledClient>,
},
Single(Box<PooledConnection<Client>>, RedisConfigOptions),
}
Expand description
A pooled Redis client.
Variants§
Cluster(Box<PooledConnection<ClusterClient>>, RedisConfigOptions)
Pool that is connected to a Redis cluster.
MultiWrite
Multiple pools that are used for multi-write.
Fields
§
primary: Box<PooledClient>
Primary PooledClient
.
§
secondaries: Vec<PooledClient>
Array of secondary PooledClient
s.
Single(Box<PooledConnection<Client>>, RedisConfigOptions)
Pool that is connected to a single Redis instance.
Implementations§
source§impl PooledClient
impl PooledClient
sourcepub fn connection(&mut self) -> Result<Connection<'_>, RedisError>
pub fn connection(&mut self) -> Result<Connection<'_>, RedisError>
Returns a pooled connection to this client.
When the connection is fetched from the pool, we also set the read and write timeouts to the configured values.
Auto Trait Implementations§
impl Freeze for PooledClient
impl !RefUnwindSafe for PooledClient
impl Send for PooledClient
impl !Sync for PooledClient
impl Unpin for PooledClient
impl !UnwindSafe for PooledClient
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
§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