Struct redis_sk::Client [−][src]
pub struct Client { /* fields omitted */ }
Expand description
The client type.
Implementations
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();
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.
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.
Instructs the client to actually connect to redis with specified timeout 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.
Returns an async connection from the client.
Returns an async connection from the client.
Returns an async connection from the client.
Returns an async connection from the client.
Returns an async multiplexed connection from the client.
A multiplexed connection can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
This requires the tokio-rt-core
feature as it uses the default tokio executor.
pub async fn get_multiplexed_async_std_connection(
&self
) -> RedisResult<MultiplexedConnection>
[src]
pub async fn get_multiplexed_async_std_connection(
&self
) -> RedisResult<MultiplexedConnection>
[src]Returns an async multiplexed connection from the client.
A multiplexed connection can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
This requires the tokio-rt-core
feature as it uses the default tokio executor.
pub async fn create_multiplexed_tokio_connection(
&self
) -> RedisResult<(MultiplexedConnection, impl Future<Output = ()>)>
[src]
pub async fn create_multiplexed_tokio_connection(
&self
) -> RedisResult<(MultiplexedConnection, impl Future<Output = ()>)>
[src]Returns an async multiplexed connection from the client and a future which must be polled
to drive any requests submitted to it (see get_multiplexed_tokio_connection
).
A multiplexed connection can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
pub async fn create_multiplexed_async_std_connection(
&self
) -> RedisResult<(MultiplexedConnection, impl Future<Output = ()>)>
[src]
pub async fn create_multiplexed_async_std_connection(
&self
) -> RedisResult<(MultiplexedConnection, impl Future<Output = ()>)>
[src]Returns an async multiplexed connection from the client and a future which must be polled
to drive any requests submitted to it (see get_multiplexed_tokio_connection
).
A multiplexed connection can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
Returns an async ConnectionManager
from the client.
The connection manager wraps a
MultiplexedConnection
. If a command to that
connection fails with a connection error, then a new connection is
established in the background and the error is returned to the caller.
This means that on connection loss at least one command will fail, but
the connection will be re-established automatically if possible. Please
refer to the ConnectionManager
docs for
detailed reconnecting behavior.
A connection manager can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
This requires the connection-manager
feature, which in turn pulls in
the Tokio executor.
Trait Implementations
Sends an already encoded (packed) command into the TCP socket and reads the single response from it. Read more
fn req_packed_commands(
&mut self,
cmd: &[u8],
offset: usize,
count: usize
) -> RedisResult<Vec<Value>>
[src]
fn req_packed_commands(
&mut self,
cmd: &[u8],
offset: usize,
count: usize
) -> RedisResult<Vec<Value>>
[src]Sends multiple already encoded (packed) command into the TCP socket
and reads count
responses from it. This is used to implement
pipelining. Read more
Returns the database this connection is bound to. Note that this information might be unreliable because it’s initially cached and also might be incorrect if the connection like object is not actually connected. Read more
Check that all connections it has are available (PING
internally).
type Connection = Connection
type Connection = Connection
The connection type this manager deals with.
type Error = RedisError
type Error = RedisError
The error type returned by Connection
s.
Attempts to create a new connection.
Determines if the connection is still connected to the database. Read more
Quickly determines if the connection is no longer usable. Read more
Auto Trait Implementations
impl RefUnwindSafe for Client
impl UnwindSafe for Client
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V