1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! ```toml
//! [dependencies.redisclient]
//! version = "*"
//! ```
//!
//! If you want use the Git version:
//!
//! ```toml
//! [dependencies.redisclient]
//! git = "https://github.com/ltoddy/redis-rs.git"
//! ```
//!
//! ### simple usage
//!
//! ```rust
//! extern crate redisclient;
//!
//! use redisclient::RedisResult;
//! use redisclient::RedisClient;
//!
//! fn run() -> RedisResult<()> {
//!     let mut client = RedisClient::new()?;
//!     client.mset(vec![("key1", 1), ("key2", 2)])?;
//!
//!     let values: Vec<String> = client.mget(vec!["key1", "key2"])?;
//!     println!("values -> {:?}", values);
//!
//!     let values: Vec<isize> = client.mget(vec!["key1", "key2"])?;
//!     println!("values -> {:?}", values);
//!
//!     Ok(())
//! }
//! ```

pub mod client;
pub mod config;
pub mod connection;
pub mod error;
pub mod macros;
pub mod pool;
pub mod protocol;

pub use client::RedisClient;
pub use error::{ErrorKind, RedisError};

pub type RedisResult<T> = std::result::Result<T, RedisError>;

#[derive(Debug, Copy, Clone, PartialEq)]
pub enum DataType {
    String,
    List,
    Set,
}