pub struct SentinelClientBuilder { /* private fields */ }Available on crate feature
sentinel only.Expand description
Used to configure and build a SentinelClient.
There are two connections that can be configured independently
- The connection towards the redis nodes (configured via
set_client_to_redis_..functions) - The connection towards the sentinel nodes (configure via
set_client_to_sentinel_..functions)
Implementations§
Source§impl SentinelClientBuilder
impl SentinelClientBuilder
Sourcepub fn new<T: IntoIterator<Item = ConnectionAddr>>(
sentinels: T,
service_name: impl AsRef<str>,
server_type: SentinelServerType,
) -> RedisResult<SentinelClientBuilder>
pub fn new<T: IntoIterator<Item = ConnectionAddr>>( sentinels: T, service_name: impl AsRef<str>, server_type: SentinelServerType, ) -> RedisResult<SentinelClientBuilder>
Creates a new SentinelClientBuilder
sentinels- Addresses of sentinel nodesservice_name- The name of the service to be queried via the sentinelsserver_type- The server type to be queried via the sentinels
Sourcepub fn build(self) -> RedisResult<SentinelClient>
pub fn build(self) -> RedisResult<SentinelClient>
Creates a new SentinelClient from the parameters
Sourcepub fn set_client_to_redis_tls_mode(
self,
tls_mode: TlsMode,
) -> SentinelClientBuilder
pub fn set_client_to_redis_tls_mode( self, tls_mode: TlsMode, ) -> SentinelClientBuilder
Set tls mode for the connection to redis
Sourcepub fn set_client_to_redis_db(self, db: i64) -> SentinelClientBuilder
pub fn set_client_to_redis_db(self, db: i64) -> SentinelClientBuilder
Set db for the connection to redis
Sourcepub fn set_client_to_redis_username(
self,
username: impl AsRef<str>,
) -> SentinelClientBuilder
pub fn set_client_to_redis_username( self, username: impl AsRef<str>, ) -> SentinelClientBuilder
Set username for the connection to redis
Sourcepub fn set_client_to_redis_password(
self,
password: impl AsRef<str>,
) -> SentinelClientBuilder
pub fn set_client_to_redis_password( self, password: impl AsRef<str>, ) -> SentinelClientBuilder
Set password for the connection to redis
Sourcepub fn set_client_to_redis_protocol(
self,
protocol: ProtocolVersion,
) -> SentinelClientBuilder
pub fn set_client_to_redis_protocol( self, protocol: ProtocolVersion, ) -> SentinelClientBuilder
Set protocol for the connection to redis
Sourcepub fn set_client_to_redis_certificates(
self,
certificates: TlsCertificates,
) -> SentinelClientBuilder
Available on crate feature tls-rustls only.
pub fn set_client_to_redis_certificates( self, certificates: TlsCertificates, ) -> SentinelClientBuilder
tls-rustls only.Set certificates for the connection to redis
Sourcepub fn set_client_to_sentinel_tls_mode(
self,
tls_mode: TlsMode,
) -> SentinelClientBuilder
pub fn set_client_to_sentinel_tls_mode( self, tls_mode: TlsMode, ) -> SentinelClientBuilder
Set tls mode for the connection to the sentinels
Sourcepub fn set_client_to_sentinel_username(
self,
username: impl AsRef<str>,
) -> SentinelClientBuilder
pub fn set_client_to_sentinel_username( self, username: impl AsRef<str>, ) -> SentinelClientBuilder
Set username for the connection to the sentinels
Sourcepub fn set_client_to_sentinel_password(
self,
password: impl AsRef<str>,
) -> SentinelClientBuilder
pub fn set_client_to_sentinel_password( self, password: impl AsRef<str>, ) -> SentinelClientBuilder
Set password for the connection to the sentinels
Sourcepub fn set_client_to_sentinel_protocol(
self,
protocol: ProtocolVersion,
) -> SentinelClientBuilder
pub fn set_client_to_sentinel_protocol( self, protocol: ProtocolVersion, ) -> SentinelClientBuilder
Set protocol for the connection to the sentinels
Sourcepub fn set_client_to_sentinel_certificates(
self,
certificates: TlsCertificates,
) -> SentinelClientBuilder
Available on crate feature tls-rustls only.
pub fn set_client_to_sentinel_certificates( self, certificates: TlsCertificates, ) -> SentinelClientBuilder
tls-rustls only.Set certificate for the connection to the sentinels
Auto Trait Implementations§
impl Freeze for SentinelClientBuilder
impl RefUnwindSafe for SentinelClientBuilder
impl Send for SentinelClientBuilder
impl Sync for SentinelClientBuilder
impl Unpin for SentinelClientBuilder
impl UnwindSafe for SentinelClientBuilder
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