pub struct Client { /* private fields */ }
Expand description
This is a Redis cluster client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn open<T>(initial_nodes: Vec<T>) -> Result<Client, RedisError>where
T: IntoConnectionInfo,
pub fn open<T>(initial_nodes: Vec<T>) -> Result<Client, RedisError>where
T: IntoConnectionInfo,
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.
§Errors
If it is failed to parse initial_nodes, an error is returned.
Sourcepub fn set_retries(&mut self, retries: Option<u32>) -> &mut Client
pub fn set_retries(&mut self, retries: Option<u32>) -> &mut Client
Set how many times we should retry a query. Set None
to retry forever.
Default: 16
Sourcepub async fn get_connection(&self) -> Result<Connection, RedisError>
pub async fn get_connection(&self) -> Result<Connection, RedisError>
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
Mutably borrows from an owned value. Read more