Expand description
A simple Redis client & RESP parser for Rust.
use redust::{resp::{Data, from_data}, Connection};
let mut conn = Connection::new("localhost:6379").await?;
let res: Data = conn.cmd(["PING"]).await?;
let deserialized: &str = from_data(res)?;
assert_eq!(deserialized, "PONG");
Connection
s implement TryStream
and Sink
for ergonomic
and idiomatic use.
Data is returned to the client as static resp::Data
. The resp crate contains several
serde utilities for converting RESP into Rust structures. For reading data from a connection,
use resp::from_data
.
Additional Features
Re-exports
pub use redust_resp as resp;
Modules
Command
trait + impelementations.- Redis models.
- Manage Redis connections with deadpool.
- Script utilities to handle SHA1 hash-based invocation.
Structs
- A TCP connection to a Redis server.
Type Definitions
- Result with an error type defaulting to
Error
. - A
Connection
that can be shared across threads.