pub struct ClusterClient { /* private fields */ }cluster only.Expand description
A Redis Cluster client, used to create connections.
Implementations§
Source§impl ClusterClient
impl ClusterClient
Sourcepub fn new<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
pub fn new<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
Creates a ClusterClient with the default parameters.
This does not create connections to the Redis Cluster, but only performs some basic checks on the initial nodes’ URLs and passwords/usernames.
§Errors
Upon failure to parse initial nodes or if the initial nodes have different passwords or usernames, an error is returned.
Sourcepub fn builder<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> ClusterClientBuilderwhere
T: IntoConnectionInfo,
pub fn builder<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> ClusterClientBuilderwhere
T: IntoConnectionInfo,
Creates a ClusterClientBuilder with the provided initial_nodes.
Sourcepub fn get_connection(&self) -> Result<ClusterConnection, RedisError>
pub fn get_connection(&self) -> Result<ClusterConnection, RedisError>
Creates new connections to Redis Cluster nodes and returns a
cluster::ClusterConnection.
§Errors
An error is returned if there is a failure while creating connections or slots.
Sourcepub fn get_connection_with_config(
&self,
config: ClusterConfig,
) -> Result<ClusterConnection, RedisError>
pub fn get_connection_with_config( &self, config: ClusterConfig, ) -> Result<ClusterConnection, RedisError>
Creates new connections to Redis Cluster nodes with a custom config and returns a
cluster_async::ClusterConnection.
§Errors
An error is returned if there is a failure while creating connections or slots.
Sourcepub async fn get_async_connection(
&self,
) -> Result<ClusterConnection, RedisError>
Available on crate feature cluster-async only.
pub async fn get_async_connection( &self, ) -> Result<ClusterConnection, RedisError>
cluster-async only.Creates new connections to Redis Cluster nodes and returns a
cluster_async::ClusterConnection.
§Errors
An error is returned if there is a failure while creating connections or slots.
Sourcepub async fn get_async_connection_with_config(
&self,
config: ClusterConfig,
) -> Result<ClusterConnection, RedisError>
Available on crate feature cluster-async only.
pub async fn get_async_connection_with_config( &self, config: ClusterConfig, ) -> Result<ClusterConnection, RedisError>
cluster-async only.Creates new connections to Redis Cluster nodes with a custom config and returns a
cluster_async::ClusterConnection.
§Errors
An error is returned if there is a failure while creating connections or slots.
Sourcepub fn get_pending_async_connection_with_config(
&self,
config: ClusterConfig,
) -> ClusterConnection
Available on crate feature cluster-async only.
pub fn get_pending_async_connection_with_config( &self, config: ClusterConfig, ) -> ClusterConnection
cluster-async only.Creates new connections to Redis Cluster nodes with a custom config and returns a
cluster_async::ClusterConnection. The connections to the cluster nodes are done in the
background so the caller won’t know if the cluster is available until the first command is sent.
Trait Implementations§
Source§impl Clone for ClusterClient
impl Clone for ClusterClient
Source§fn clone(&self) -> ClusterClient
fn clone(&self) -> ClusterClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more