pub struct Client { /* private fields */ }
Expand description
This is a Redis cluster client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn open<T: IntoConnectionInfo>(initial_nodes: Vec<T>) -> RedisResult<Client>
pub fn open<T: IntoConnectionInfo>(initial_nodes: Vec<T>) -> RedisResult<Client>
Connect to a redis cluster server and return a cluster client. This does not actually open a connection yet but it performs some basic checks on the URL. The password of initial nodes must be the same all.
§Errors
If it is failed to parse initial_nodes or the initial nodes has different password, an error is returned.
Sourcepub fn open_with_auth<T: IntoConnectionInfo>(
initial_nodes: Vec<T>,
password: String,
) -> RedisResult<Client>
👎Deprecated: Please use Builder instead
pub fn open_with_auth<T: IntoConnectionInfo>( initial_nodes: Vec<T>, password: String, ) -> RedisResult<Client>
Connect to a redis cluster server with authentication and return a cluster client. This does not actually open a connection yet but it performs some basic checks on the URL.
Redis cluster’s password must be the same all. This function is not use the password of initial nodes.
§Errors
If it is failed to parse initial_nodes, an error is returned.
Sourcepub fn get_connection(&self) -> RedisResult<Connection>
pub fn get_connection(&self) -> RedisResult<Connection>
Open and get a Redis cluster connection.
§Errors
If it is failed to open connections and to create slots, an error is returned.