pub async fn connect(addr: impl ToSocketAddrs) -> Result<RespConnection, Error>
Expand description
Connect to a Redis server and return a Future that resolves to a
RespConnection
for reading and writing asynchronously.
Each RespConnection
implements both Sink
and Stream
and read and
writes RESP
objects.
This is a low-level interface to enable the creation of higher-level functionality.
The sink and stream sides behave independently of each other, it is the responsibility of the calling application to determine what results are paired to a particular command.
But since most Redis usages involve issue commands that result in one
single result, this library also implements paired_connect
.