Struct redis::aio::Connection
source · [−]pub struct Connection<C = Pin<Box<dyn AsyncStream + Send + Sync>>> { /* private fields */ }
aio
only.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: &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
sourceimpl<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
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more