Crate respite

Source
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§

RespConfig
Configuration of limits for reading a RESP stream. All values are shared across threads to prevent canceling futures.
RespReader
A wrapper for AsyncRead to allow reading a RESP stream, mainly in three ways.
RespWriter
A wrapper for AsyncWrite to allow writing a RESP stream.

Enums§

RespError
An error encountered while reading a RESP stream.
RespFrame
A single frame in a RESP stream.
RespPrimitive
A primitive value that can be used as the key for a map or set.
RespRequest
One piece of a RESP request, split into pieces for sending through a channel.
RespValue
A RESP value, possibly built from many frames.
RespVersion
A version of the RESP protocol.