Struct deadpool_redis::cluster::ClusterClient
source · pub struct ClusterClient { /* private fields */ }
Expand description
This is a Redis Cluster client.
Implementations§
source§impl ClusterClient
impl ClusterClient
sourcepub fn new<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
pub fn new<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
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>(
initial_nodes: impl IntoIterator<Item = T>,
) -> ClusterClientBuilderwhere
T: IntoConnectionInfo,
pub fn builder<T>(
initial_nodes: impl IntoIterator<Item = T>,
) -> ClusterClientBuilderwhere
T: IntoConnectionInfo,
Creates a ClusterClientBuilder
with the provided initial_nodes.
sourcepub fn get_connection(&self) -> Result<ClusterConnection, RedisError>
pub fn get_connection(&self) -> Result<ClusterConnection, RedisError>
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,
) -> Result<ClusterConnection, RedisError>
pub async fn get_async_connection( &self, ) -> Result<ClusterConnection, RedisError>
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>(initial_nodes: Vec<T>) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
👎Deprecated since 0.22.0: Use new()
pub fn open<T>(initial_nodes: Vec<T>) -> Result<ClusterClient, RedisError>where
T: IntoConnectionInfo,
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 moreAuto 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)