pub struct ClusterClient { /* private fields */ }
Available on crate feature
cluster
only.Expand description
This is a Redis cluster client.
Implementations§
Source§impl ClusterClient
impl ClusterClient
Sourcepub fn open<T: IntoConnectionInfo>(
initial_nodes: Vec<T>,
) -> RedisResult<ClusterClient>
pub fn open<T: IntoConnectionInfo>( initial_nodes: Vec<T>, ) -> RedisResult<ClusterClient>
Create a ClusterClient with the default configuration. Despite the name, this does not actually open a connection to Redis Cluster, but only performs 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 get_connection(&self) -> RedisResult<ClusterConnection>
pub fn get_connection(&self) -> RedisResult<ClusterConnection>
Opens connections to Redis Cluster nodes and returns a ClusterConnection.
§Errors
An error is returned if there is a failure to open connections or to create slots.
Trait Implementations§
Source§impl Clone for ClusterClient
impl Clone for ClusterClient
Source§fn clone(&self) -> ClusterClient
fn clone(&self) -> ClusterClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl ManageConnection for ClusterClient
Available on crate feature r2d2
only.
impl ManageConnection for ClusterClient
Available on crate feature
r2d2
only.Source§type Connection = ClusterConnection
type Connection = ClusterConnection
The connection type this manager deals with.
Source§type Error = RedisError
type Error = RedisError
The error type returned by
Connection
s.Source§fn connect(&self) -> Result<Self::Connection, Self::Error>
fn connect(&self) -> Result<Self::Connection, Self::Error>
Attempts to create a new connection.
Source§fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
Determines if the connection is still connected to the database. Read more
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Quickly determines if the connection is no longer usable. Read more
Auto Trait Implementations§
impl Freeze for ClusterClient
impl RefUnwindSafe for ClusterClient
impl Send for ClusterClient
impl Sync for ClusterClient
impl Unpin for ClusterClient
impl UnwindSafe for ClusterClient
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
Mutably borrows from an owned value. Read more