pub trait ConnectionLike {
// Required methods
fn req_packed_command<'a>(
&'a mut self,
cmd: &'a Cmd,
) -> Pin<Box<dyn Future<Output = Result<Value, RedisError>> + Send + 'a>>;
fn req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, RedisError>> + Send + 'a>>;
fn get_db(&self) -> i64;
}
Expand description
An async abstraction over connections.
Required Methods§
Sourcefn req_packed_command<'a>(
&'a mut self,
cmd: &'a Cmd,
) -> Pin<Box<dyn Future<Output = Result<Value, RedisError>> + Send + 'a>>
fn req_packed_command<'a>( &'a mut self, cmd: &'a Cmd, ) -> Pin<Box<dyn Future<Output = Result<Value, RedisError>> + Send + 'a>>
Sends an already encoded (packed) command into the TCP socket and reads the single response from it.
Sourcefn req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, RedisError>> + Send + 'a>>
fn req_packed_commands<'a>( &'a mut self, cmd: &'a Pipeline, offset: usize, count: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, RedisError>> + Send + 'a>>
Sends multiple already encoded (packed) command into the TCP socket
and reads count
responses from it. This is used to implement
pipelining.