pub struct RedisCacheConfig {
pub url: String,
pub pool_size: u32,
pub connection_timeout: Duration,
pub command_timeout: Duration,
pub key_prefix: String,
pub default_ttl: Option<Duration>,
pub cluster_mode: bool,
pub database: u8,
pub tls: bool,
pub username: Option<String>,
pub password: Option<String>,
}Expand description
Configuration for Redis cache.
Fields§
§url: StringRedis connection URL.
pool_size: u32Connection pool size.
connection_timeout: DurationConnection timeout.
command_timeout: DurationCommand timeout.
key_prefix: StringKey prefix for all entries.
default_ttl: Option<Duration>Default TTL.
cluster_mode: boolEnable cluster mode.
database: u8Database number (0-15).
tls: boolEnable TLS.
username: Option<String>Username for AUTH.
password: Option<String>Password for AUTH.
Implementations§
Source§impl RedisCacheConfig
impl RedisCacheConfig
Sourcepub fn with_pool_size(self, size: u32) -> Self
pub fn with_pool_size(self, size: u32) -> Self
Set pool size.
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Set key prefix.
Trait Implementations§
Source§impl Clone for RedisCacheConfig
impl Clone for RedisCacheConfig
Source§fn clone(&self) -> RedisCacheConfig
fn clone(&self) -> RedisCacheConfig
Returns a duplicate 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 moreSource§impl Debug for RedisCacheConfig
impl Debug for RedisCacheConfig
Auto Trait Implementations§
impl Freeze for RedisCacheConfig
impl RefUnwindSafe for RedisCacheConfig
impl Send for RedisCacheConfig
impl Sync for RedisCacheConfig
impl Unpin for RedisCacheConfig
impl UnwindSafe for RedisCacheConfig
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