pub struct RedisSentinelBuilder { /* private fields */ }Expand description
Builder for a Redis Sentinel topology.
§Example
use redis_server_wrapper::RedisSentinel;
let sentinel = RedisSentinel::builder()
.master_name("mymaster")
.master_port(6390)
.replicas(2)
.sentinels(3)
.start()
.await
.unwrap();
assert!(sentinel.is_healthy().await);Implementations§
Source§impl RedisSentinelBuilder
impl RedisSentinelBuilder
pub fn master_name(self, name: impl Into<String>) -> Self
pub fn master_port(self, port: u16) -> Self
pub fn replicas(self, n: u16) -> Self
pub fn replica_base_port(self, port: u16) -> Self
pub fn sentinels(self, n: u16) -> Self
pub fn sentinel_base_port(self, port: u16) -> Self
pub fn quorum(self, q: u16) -> Self
pub fn bind(self, bind: impl Into<String>) -> Self
pub fn down_after_ms(self, ms: u64) -> Self
pub fn failover_timeout_ms(self, ms: u64) -> Self
pub fn redis_server_bin(self, bin: impl Into<String>) -> Self
pub fn redis_cli_bin(self, bin: impl Into<String>) -> Self
Sourcepub async fn start(self) -> Result<RedisSentinelHandle>
pub async fn start(self) -> Result<RedisSentinelHandle>
Start the full topology: master, replicas, sentinels.
Auto Trait Implementations§
impl Freeze for RedisSentinelBuilder
impl RefUnwindSafe for RedisSentinelBuilder
impl Send for RedisSentinelBuilder
impl Sync for RedisSentinelBuilder
impl Unpin for RedisSentinelBuilder
impl UnsafeUnpin for RedisSentinelBuilder
impl UnwindSafe for RedisSentinelBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more