6 releases (3 breaking)

0.4.0 Apr 23, 2023
0.3.1 Nov 24, 2022
0.3.0 Jul 7, 2022
0.2.0 May 25, 2022
0.1.1 May 24, 2022

#2033 in Database interfaces

27 downloads per month

MIT license

89KB
2.5K SLoC

Redust

Redust Documentation

A simple Redis client for Rust.


lib.rs:

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");

Connections 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

  • command: type-safe Redis interactions
  • pool: connection pooling with [bb8]
  • model: complex Redis responses, based on [serde]
  • script: Redis scripting utilities

Dependencies

~5–14MB
~170K SLoC