Expand description
Abstractions for reading the RESP protocol.
You can read a RESP stream in several ways. Which one is appropriate depends on your goals.
§Frames
With RespReader::frame
, you can read each individual frame from a RESP stream and decide
what to do with it. This allows you to process streams without buffering.
§Requests
RespReader::requests
will pass each component of a Redis-style request to a closure you
provide. This allows for easily sending each argument over a channel to another task.
§Values
You can also use RespReader::value
, which will buffer values and return a whole tree of
frames for arrays, maps, sets, etc. This is primarily meant for testing purposes, but could
also be useful in cases where performance isn’t super important.
Macros§
- resp
- Conveniently create a
RespValue
- resp_
primitive - Conveniently create a
RespPrimitive
Structs§
- Resp
Config - Configuration of limits for reading a RESP stream. All values are shared across threads to prevent canceling futures.
- Resp
Reader - A wrapper for
AsyncRead
to allow reading a RESP stream, mainly in three ways. - Resp
Writer - A wrapper for
AsyncWrite
to allow writing a RESP stream.
Enums§
- Resp
Error - An error encountered while reading a RESP stream.
- Resp
Frame - A single frame in a RESP stream.
- Resp
Primitive - A primitive value that can be used as the key for a map or set.
- Resp
Request - One piece of a RESP request, split into pieces for sending through a channel.
- Resp
Value - A RESP value, possibly built from many frames.
- Resp
Version - A version of the RESP protocol.