[][src]Crate darkredis

Asyncronous redis client built using futures and async await, with optional connection pooling.

use darkredis::*;

// Create a connection pool with 4 connections
let pool = ConnectionPool::create("".into(), None, 4).await.unwrap();
let mut connection = pool.get().await; // Grab a connection from the pool

connection.set("some-key", "Hello, world!").await.unwrap();
assert_eq!(connection.get("some-key").await.unwrap(), Some("Hello, world!".into()));



A struct for defining commands manually. If you want pipelining, use CommandList.


A struct for defining commands manually, which allows for pipelining of several commands. If you need to only run one command, use Command, which has almost the same API.


A connection to Redis. Copying is cheap as the inner type is a simple, futures-aware, Arc<Mutex>, and will not create a new connection. Use a ConnectionPool if you want to use pooled conections. Every convenience function can work with any kind of data as long as it can be converted into bytes.


A connection pool. Clones are cheap and is the expected way to send the pool around your application.



The darkredis error type.


Enum depicting the various possible responses one can get from Redis.

Type Definitions


Result type used in the whole crate.