ConnectionLike in redis::aio - Rust
Description: An async abstraction over connections.

Skip to main content

## ConnectionLike

# Trait ConnectionLike

Source

    pub trait ConnectionLike {
        // Required methods
        fn req_packed_command<'a>(
            &'a mut self,
            cmd: &'a Cmd,
        ) -> RedisFuture<'a, Value>;
        fn get_db(&self) -> i64;
    }

Available on crate feature `aio` only.
Expand description

An async abstraction over connections.

## Required Methods§

Source

#### fn req_packed_command<'a>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, Value>

Sends an already encoded (packed) command into the TCP socket and reads the single response from it.

Source

#### fn get_db(&self) -> i64

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.

## Implementors§

Source§

### impl ConnectionLike for ConnectionManager

Source§

### impl ConnectionLike for MultiplexedConnection

Source§

### impl<C> ConnectionLike for ClusterConnection<C>
where C: ConnectionLike + Send + Clone + Unpin + Sync + Connect + 'static,

Available on crate features `cluster-async` and `cluster` only.