pub struct PartialRedisConfigOptions {
pub max_connections: Option<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: Option<u32>
Maximum number of connections managed by the pool.
Defaults to 2x limits.max_thread_count
or a minimum of 24.
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 PartialRedisConfigOptions
impl Clone for PartialRedisConfigOptions
Source§fn clone(&self) -> PartialRedisConfigOptions
fn clone(&self) -> PartialRedisConfigOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PartialRedisConfigOptions
impl Debug for PartialRedisConfigOptions
Source§impl Default for PartialRedisConfigOptions
impl Default for PartialRedisConfigOptions
Source§impl<'de> Deserialize<'de> for PartialRedisConfigOptionswhere
PartialRedisConfigOptions: Default,
impl<'de> Deserialize<'de> for PartialRedisConfigOptionswhere
PartialRedisConfigOptions: Default,
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>,
impl Eq for PartialRedisConfigOptions
impl StructuralPartialEq for PartialRedisConfigOptions
Auto Trait Implementations§
impl Freeze for PartialRedisConfigOptions
impl RefUnwindSafe for PartialRedisConfigOptions
impl Send for PartialRedisConfigOptions
impl Sync for PartialRedisConfigOptions
impl Unpin for PartialRedisConfigOptions
impl UnwindSafe for PartialRedisConfigOptions
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
§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.