pub struct RedisConfigOptions {
pub max_connections: u32,
pub idle_timeout: u64,
pub create_timeout: Option<u64>,
pub recycle_timeout: Option<u64>,
pub wait_timeout: Option<u64>,
pub recycle_check_frequency: usize,
}
Expand description
Additional configuration options for a redis client.
Fields§
§max_connections: u32
Maximum number of connections managed by the pool.
idle_timeout: u64
Sets the idle timeout used by the pool, in seconds.
The idle timeout defines the maximum time a connection will be kept in the pool if unused.
create_timeout: Option<u64>
Sets the maximum time in seconds to wait when establishing a new Redis connection.
If a connection cannot be established within this duration, it is considered a failure. Applies when the pool needs to grow or create fresh connections.
recycle_timeout: Option<u64>
Sets the maximum time in seconds to validate an existing connection when it is recycled.
Recycling involves checking whether an idle connection is still alive before reuse. If validation exceeds this timeout, the connection is discarded and a new fetch from the pool is attempted.
wait_timeout: Option<u64>
Sets the maximum time, in seconds, that a caller is allowed to wait when requesting a connection from the pool.
If a connection does not become available within this period, the attempt will fail with a timeout error. This setting helps prevent indefinite blocking when the pool is exhausted.
recycle_check_frequency: usize
Sets the number of times after which the connection will check whether it is active when being recycled.
A frequency of 1, means that the connection will check whether it is active every time it is recycled.
Trait Implementations§
Source§impl Clone for RedisConfigOptions
impl Clone for RedisConfigOptions
Source§fn clone(&self) -> RedisConfigOptions
fn clone(&self) -> RedisConfigOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RedisConfigOptions
impl Debug for RedisConfigOptions
Source§impl Default for RedisConfigOptions
impl Default for RedisConfigOptions
Source§impl<'de> Deserialize<'de> for RedisConfigOptions
impl<'de> Deserialize<'de> for RedisConfigOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RedisConfigOptions
impl PartialEq for RedisConfigOptions
Source§impl Serialize for RedisConfigOptions
impl Serialize for RedisConfigOptions
impl Eq for RedisConfigOptions
impl StructuralPartialEq for RedisConfigOptions
Auto Trait Implementations§
impl Freeze for RedisConfigOptions
impl RefUnwindSafe for RedisConfigOptions
impl Send for RedisConfigOptions
impl Sync for RedisConfigOptions
impl Unpin for RedisConfigOptions
impl UnwindSafe for RedisConfigOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.