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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more