pub struct RedisConnection {
pub host: String,
pub port: u16,
pub db: u32,
pub username: Option<String>,
pub password: Option<String>,
pub key_prefix: String,
pub sentinels: Vec<RedisSentinel>,
pub sentinel_password: Option<String>,
pub name: String,
pub cluster: RedisClusterConnection,
pub cluster_nodes: Vec<ClusterNode>,
}Fields§
§host: String§port: u16§db: u32§username: Option<String>§password: Option<String>§key_prefix: String§sentinels: Vec<RedisSentinel>§sentinel_password: Option<String>§name: String§cluster: RedisClusterConnection§cluster_nodes: Vec<ClusterNode>Legacy field kept for backward compatibility. Prefer database.redis.cluster.nodes.
Implementations§
Source§impl RedisConnection
impl RedisConnection
Sourcepub fn is_sentinel_configured(&self) -> bool
pub fn is_sentinel_configured(&self) -> bool
Returns true if Redis Sentinel is configured.
Sourcepub fn has_cluster_nodes(&self) -> bool
pub fn has_cluster_nodes(&self) -> bool
Returns true when cluster nodes are configured via either the new (cluster.nodes)
or legacy (cluster_nodes) field.
Sourcepub fn cluster_node_urls(&self) -> Vec<String>
pub fn cluster_node_urls(&self) -> Vec<String>
Returns normalized Redis Cluster seed URLs from the canonical cluster configuration.
Falls back to legacy cluster_nodes for backward compatibility.
Sourcepub fn normalize_cluster_seed_urls(&self, seeds: &[String]) -> Vec<String>
pub fn normalize_cluster_seed_urls(&self, seeds: &[String]) -> Vec<String>
Normalizes any list of seed strings (host:port, redis://..., rediss://...) using
shared cluster auth/TLS options.
Trait Implementations§
Source§impl Clone for RedisConnection
impl Clone for RedisConnection
Source§fn clone(&self) -> RedisConnection
fn clone(&self) -> RedisConnection
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 RedisConnection
impl Debug for RedisConnection
Source§impl Default for RedisConnection
impl Default for RedisConnection
Source§impl<'de> Deserialize<'de> for RedisConnectionwhere
RedisConnection: Default,
impl<'de> Deserialize<'de> for RedisConnectionwhere
RedisConnection: 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RedisConnection
impl RefUnwindSafe for RedisConnection
impl Send for RedisConnection
impl Sync for RedisConnection
impl Unpin for RedisConnection
impl UnsafeUnpin for RedisConnection
impl UnwindSafe for RedisConnection
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