pub struct SentinelConfig {
pub master_name: String,
pub sentinels: Vec<SentinelEndpoint>,
pub password: Option<String>,
pub failover_timeout: Duration,
pub check_interval: Duration,
pub max_retries: usize,
}Expand description
Configuration for Redis Sentinel
Fields§
§master_name: StringMaster name to monitor
sentinels: Vec<SentinelEndpoint>List of sentinel endpoints
password: Option<String>Password for sentinel authentication
failover_timeout: DurationTimeout for failover operations
check_interval: DurationInterval for checking master status
max_retries: usizeMaximum number of failover retries
Implementations§
Source§impl SentinelConfig
impl SentinelConfig
Sourcepub fn add_sentinel(self, addr: impl AsRef<str>) -> Self
pub fn add_sentinel(self, addr: impl AsRef<str>) -> Self
Add a sentinel endpoint
Sourcepub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
Set sentinel password
Sourcepub const fn with_failover_timeout(self, timeout: Duration) -> Self
pub const fn with_failover_timeout(self, timeout: Duration) -> Self
Set failover timeout
Sourcepub const fn with_check_interval(self, interval: Duration) -> Self
pub const fn with_check_interval(self, interval: Duration) -> Self
Set check interval
Sourcepub const fn with_max_retries(self, retries: usize) -> Self
pub const fn with_max_retries(self, retries: usize) -> Self
Set maximum retries
Trait Implementations§
Source§impl Clone for SentinelConfig
impl Clone for SentinelConfig
Source§fn clone(&self) -> SentinelConfig
fn clone(&self) -> SentinelConfig
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 moreAuto Trait Implementations§
impl Freeze for SentinelConfig
impl RefUnwindSafe for SentinelConfig
impl Send for SentinelConfig
impl Sync for SentinelConfig
impl Unpin for SentinelConfig
impl UnwindSafe for SentinelConfig
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