Struct redis::cluster::ClusterClient
source · [−]pub struct ClusterClient { /* private fields */ }
cluster
only.Expand description
This is a Redis cluster client.
Implementations
sourceimpl 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
sourceimpl Clone for ClusterClient
impl Clone for ClusterClient
sourcefn clone(&self) -> ClusterClient
fn clone(&self) -> ClusterClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ManageConnection for ClusterClient
Available on crate feature r2d2
only.
impl ManageConnection for ClusterClient
r2d2
only.type Connection = ClusterConnection
type Connection = ClusterConnection
The connection type this manager deals with.
type Error = RedisError
type Error = RedisError
The error type returned by Connection
s.
sourcefn connect(&self) -> Result<Self::Connection, Self::Error>
fn connect(&self) -> Result<Self::Connection, Self::Error>
Attempts to create a new connection.
sourcefn 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
sourcefn 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 RefUnwindSafe for ClusterClient
impl Send for ClusterClient
impl Sync for ClusterClient
impl Unpin for ClusterClient
impl UnwindSafe for ClusterClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more