Struct redis::cluster::ClusterClientBuilder
source · [−]pub struct ClusterClientBuilder { /* private fields */ }
cluster
only.Expand description
Used to configure and build a ClusterClient.
Implementations
sourceimpl ClusterClientBuilder
impl ClusterClientBuilder
sourcepub fn new<T: IntoConnectionInfo>(initial_nodes: Vec<T>) -> ClusterClientBuilder
pub fn new<T: IntoConnectionInfo>(initial_nodes: Vec<T>) -> ClusterClientBuilder
Generate the base configuration for new Client.
sourcepub fn open(self) -> RedisResult<ClusterClient>
pub fn open(self) -> RedisResult<ClusterClient>
Builds a ClusterClient. Despite the name, this does not actually open a connection to Redis Cluster, but will perform some basic checks of the initial nodes’ URLs and passwords.
Errors
Upon failure to parse initial nodes or if the initial nodes have different passwords, an error is returned.
sourcepub fn password(self, password: String) -> ClusterClientBuilder
pub fn password(self, password: String) -> ClusterClientBuilder
Set password for new ClusterClient.
sourcepub fn readonly(self, readonly: bool) -> ClusterClientBuilder
pub fn readonly(self, readonly: bool) -> ClusterClientBuilder
Set read only mode for new ClusterClient (default is false). If readonly is true, all queries will go to replica nodes. If there are no replica nodes, queries will be issued to the primary nodes.
Auto Trait Implementations
impl !RefUnwindSafe for ClusterClientBuilder
impl Send for ClusterClientBuilder
impl Sync for ClusterClientBuilder
impl Unpin for ClusterClientBuilder
impl !UnwindSafe for ClusterClientBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more