Struct redis::aio::Connection
source · [−]pub struct Connection<C = Pin<Box<dyn AsyncStream + Send + Sync>>> { /* private fields */ }
Expand description
Represents a stateful redis TCP connection.
Implementations
sourceimpl<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: &ConnectionInfo, con: C) -> RedisResult<Self>
pub async fn new(connection_info: &ConnectionInfo, con: C) -> RedisResult<Self>
Constructs a new Connection
out of a AsyncRead + AsyncWrite
object
and a ConnectionInfo
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
Trait Implementations
sourceimpl<C> ConnectionLike for Connection<C> where
C: Unpin + AsyncRead + AsyncWrite + Send,
impl<C> ConnectionLike for Connection<C> where
C: Unpin + AsyncRead + AsyncWrite + Send,
sourcefn 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. Read more
sourcefn 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. Read more
Auto Trait Implementations
impl<C = Pin<Box<dyn AsyncStream + Send + Sync + 'static, Global>>> !RefUnwindSafe for Connection<C>
impl<C> Send for Connection<C> where
C: Send,
impl<C> Sync for Connection<C> where
C: Sync,
impl<C> Unpin for Connection<C> where
C: Unpin,
impl<C = Pin<Box<dyn AsyncStream + Send + Sync + 'static, Global>>> !UnwindSafe for Connection<C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more