Struct redis::cluster::ClusterClient
source · pub struct ClusterClient { /* private fields */ }
cluster
only.Expand description
This is a Redis Cluster client.
Implementations§
source§impl ClusterClient
impl ClusterClient
sourcepub fn new<T: IntoConnectionInfo>(
initial_nodes: Vec<T>
) -> RedisResult<ClusterClient>
pub fn new<T: IntoConnectionInfo>( initial_nodes: Vec<T> ) -> RedisResult<ClusterClient>
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: IntoConnectionInfo>(
initial_nodes: Vec<T>
) -> ClusterClientBuilder
pub fn builder<T: IntoConnectionInfo>( initial_nodes: Vec<T> ) -> ClusterClientBuilder
Creates a ClusterClientBuilder
with the provided initial_nodes.
sourcepub fn get_connection(&self) -> RedisResult<ClusterConnection>
pub fn get_connection(&self) -> RedisResult<ClusterConnection>
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 async fn get_async_connection(&self) -> RedisResult<ClusterConnection>
pub async fn get_async_connection(&self) -> RedisResult<ClusterConnection>
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 fn open<T: IntoConnectionInfo>(
initial_nodes: Vec<T>
) -> RedisResult<ClusterClient>
👎Deprecated since 0.22.0: Use new()
pub fn open<T: IntoConnectionInfo>( initial_nodes: Vec<T> ) -> RedisResult<ClusterClient>
Use new()
.
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 moresource§impl ManageConnection for ClusterClient
Available on crate feature r2d2
only.
impl ManageConnection for ClusterClient
r2d2
only.§type Connection = ClusterConnection<Connection>
type Connection = ClusterConnection<Connection>
§type Error = RedisError
type Error = RedisError
Connection
s.