16 releases
0.3.9 | Feb 10, 2025 |
---|---|
0.3.7 | Jan 15, 2025 |
0.3.4 | Dec 31, 2024 |
0.3.3 | Apr 13, 2024 |
0.3.2 | Mar 30, 2024 |
#1203 in Database interfaces
1,109 downloads per month
Used in bradis
80KB
2K
SLoC
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.
Respite
Some tools for reading and writing RESP streams.
Usage
To use respite
, add this to your Cargo.toml
:
[dependencies]
respite = "*"
Next, add this to your crate:
use respite::{RespReader, RespWriter, RespVersion};
Dependencies
~3.5–10MB
~92K SLoC