Crate redis_cluster_rs [−] [src]
This is a rust implementation for Redis cluster library.
This library extends redis-rs library to be able to use cluster. Client impletemts traits of ConnectionLike and Commands. So you can use redis-rs's access methods. If you want more information, read document of redis-rs.
Note that this library is currently not have features of Pipeline and Pubsub.
Example
extern crate redis_cluster_rs; use redis_cluster_rs::{Client, Connection, Commands}; fn main() { let nodes = vec!["redis://127.0.0.1:6379/", "redis://127.0.0.1:6378/", "redis://127.0.0.1:6377/"]; let client = Client::open(nodes).unwrap(); let connection = client.get_connection().unwrap(); let _: () = connection.set("test", "test_data").unwrap(); let res: String = connection.get("test").unwrap(); assert_eq!(res, "test_data"); }
Structs
Client |
This is a Redis cluster client. |
Connection |
This is a connection of Redis cluster. |
Traits
Commands |
Implements common redis commands for connection like objects. This allows you to send commands straight to a connection or client. It is also implemented for redis results of clients which makes for very convenient access in some basic cases. |
ConnectionLike |
Implements the "stateless" part of the connection interface that is used by the
different objects in redis-rs. Primarily it obviously applies to |
Type Definitions
RedisResult |
Library generic result type. |