[][src]Struct redis::Client

pub struct Client { /* fields omitted */ }

The client type.

Methods

impl Client[src]

The client acts as connector to the redis server. By itself it does not do much other than providing a convenient way to fetch a connection from it. In the future the plan is to provide a connection pool in the client.

When opening a client a URL in the following format should be used:

redis://host:port/db

Example usage::

let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let con = client.get_connection().unwrap();

pub fn open<T: IntoConnectionInfo>(params: T) -> RedisResult<Client>[src]

Connects to a redis server and returns a client. This does not actually open a connection yet but it does perform some basic checks on the URL that might make the operation fail.

pub fn get_connection(&self) -> RedisResult<Connection>[src]

Instructs the client to actually connect to redis and returns a connection object. The connection object can be used to send commands to the server. This can fail with a variety of errors (like unreachable host) so it's important that you handle those errors.

pub fn get_async_connection(
    &self
) -> impl Future<Item = Connection, Error = RedisError>
[src]

pub fn get_shared_async_connection(
    &self
) -> impl Future<Item = SharedConnection, Error = RedisError>
[src]

Trait Implementations

impl ConnectionLike for Client[src]

impl Clone for Client[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Client[src]

Auto Trait Implementations

impl Unpin for Client

impl Sync for Client

impl Send for Client

impl RefUnwindSafe for Client

impl UnwindSafe for Client

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T