Struct redis::aio::Connection
source · pub struct Connection<C = Pin<Box<dyn AsyncStream + Send + Sync>>> { /* private fields */ }
Available on crate feature
aio
only.Expand description
Represents a stateful redis TCP connection.
Implementations§
source§impl<C> Connection<C>where
C: Unpin + AsyncRead + AsyncWrite + Send,
impl<C> Connection<C>where
C: Unpin + AsyncRead + AsyncWrite + Send,
sourcepub async fn new(
connection_info: &RedisConnectionInfo,
con: C
) -> RedisResult<Self>
pub async fn new(
connection_info: &RedisConnectionInfo,
con: C
) -> RedisResult<Self>
Constructs a new Connection
out of a AsyncRead + AsyncWrite
object
and a RedisConnectionInfo
sourcepub fn into_pubsub(self) -> PubSub<C>
pub fn into_pubsub(self) -> PubSub<C>
Converts this Connection
into PubSub
.
sourcepub fn into_monitor(self) -> Monitor<C>
pub fn into_monitor(self) -> Monitor<C>
Converts this Connection
into Monitor
source§impl<C> Connection<AsyncStdWrapped<C>>where
C: Unpin + Read + Write + Send,
impl<C> Connection<AsyncStdWrapped<C>>where
C: Unpin + Read + Write + Send,
sourcepub async fn new_async_std(
connection_info: &RedisConnectionInfo,
con: C
) -> RedisResult<Self>
Available on crate feature async-std-comp
only.
pub async fn new_async_std(
connection_info: &RedisConnectionInfo,
con: C
) -> RedisResult<Self>
async-std-comp
only.Constructs a new Connection
out of a async_std::io::AsyncRead + async_std::io::AsyncWrite
object
and a RedisConnectionInfo
Trait Implementations§
source§impl<C> ConnectionLike for Connection<C>where
C: Unpin + AsyncRead + AsyncWrite + Send,
impl<C> ConnectionLike for Connection<C>where
C: Unpin + AsyncRead + AsyncWrite + Send,
source§fn req_packed_command<'a>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, Value>
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 req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize
) -> RedisFuture<'a, Vec<Value>>
fn req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize
) -> RedisFuture<'a, Vec<Value>>
Sends multiple already encoded (packed) command into the TCP socket
and reads
count
responses from it. This is used to implement
pipelining.