Struct redis_client::redis::RedisClient [] [src]

pub struct RedisClient {
    // some fields omitted
}

Methods

impl RedisClient

A RedisClient is a structure to send command to redis and receive the response. All RedisClient's methods are performed synchronously.

When creating a RedisClient it will automatically create a connection. Therefore when it is created it uses the host and the port.

Example:

let mut client = try!(redis_client::RedisClient::new("127.0.0.1", "6379"));

fn new(host: &'static str, port: &'static str) -> Result<RedisClient, RedisError>

fn exec_redis_command(&mut self, redis_command: &mut RedisCommand) -> Result<RedisResult, RedisError>

Execute a RedisCommand

fn exec_redis_pipeline_command(&mut self, redis_command: &mut RedisCommand) -> Result<Vec<RedisResult>, RedisError>

Execute a pipeline of RedisCommand

Trait Implementations

impl CommandSender for RedisClient

fn append<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn auth<R: From<RedisResult>, P: ToString>(&mut self, password: P) -> Result<R, RedisError>

fn bgrewriteaof<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn bgsave<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn bitcount<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn bitcount_range<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

fn blpop<R: From<RedisResult>, K: ToString>(&mut self, key: K, timeout: u32) -> Result<R, RedisError>

fn mblpop<R: From<RedisResult>, K: ToString>(&mut self, keys: Vec<K>, timeout: u32) -> Result<R, RedisError>

fn brpop<R: From<RedisResult>, K: ToString>(&mut self, key: K, timeout: u32) -> Result<R, RedisError>

fn mbrpop<R: From<RedisResult>, K: ToString>(&mut self, keys: Vec<K>, timeout: u32) -> Result<R, RedisError>

fn brpoplpush<R: From<RedisResult>, S: ToString, D: ToString>(&mut self, source: S, dest: D, timeout: u32) -> Result<R, RedisError>

fn decr<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn decrby<R: From<RedisResult>, K: ToString>(&mut self, key: K, increment: i64) -> Result<R, RedisError>

fn del<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn mdel<R: From<RedisResult>, K: ToString>(&mut self, keys: Vec<K>) -> Result<R, RedisError>

fn discard<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn echo<R: From<RedisResult>, K: ToString>(&mut self, msg: K) -> Result<R, RedisError>

fn exec<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn exists<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn mexists<R: From<RedisResult>, K: ToString>(&mut self, keys: Vec<K>) -> Result<R, RedisError>

fn expire<R: From<RedisResult>, K: ToString>(&mut self, key: K, expiry: i64) -> Result<R, RedisError>

fn expireat<R: From<RedisResult>, K: ToString>(&mut self, key: K, timestamp: i64) -> Result<R, RedisError>

fn get<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn getrange<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

fn hdel<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F) -> Result<R, RedisError>

fn hmdel<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, fields: Vec<V>) -> Result<R, RedisError>

fn hexists<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F) -> Result<R, RedisError>

fn hget<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F) -> Result<R, RedisError>

fn hgetall<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn hincrby<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F, increment: i64) -> Result<R, RedisError>

fn hincrbyfloat<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F, increment: f64) -> Result<R, RedisError>

fn hkeys<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn hlen<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn hmget<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, fields: Vec<F>) -> Result<R, RedisError>

fn hmset<R: From<RedisResult>, K: ToString>(&mut self, key: K, fields: HashMap<String, K>) -> Result<R, RedisError>

fn hset<R: From<RedisResult>, K: ToString, F: ToString, V: ToString>(&mut self, key: K, field: F, value: V) -> Result<R, RedisError>

fn hstrlen<R: From<RedisResult>, K: ToString, F: ToString>(&mut self, key: K, field: F) -> Result<R, RedisError>

fn hsetnx<R: From<RedisResult>, K: ToString, F: ToString, V: ToString>(&mut self, key: K, field: F, value: V) -> Result<R, RedisError>

fn hvals<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn lindex<R: From<RedisResult>, K: ToString>(&mut self, key: K, index: i32) -> Result<R, RedisError>

fn linsert_after<R: From<RedisResult>, K: ToString, P: ToString, V: ToString>(&mut self, key: K, pivot: P, value: V) -> Result<R, RedisError>

fn linsert_before<R: From<RedisResult>, K: ToString, P: ToString, V: ToString>(&mut self, key: K, pivot: P, value: V) -> Result<R, RedisError>

fn llen<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn lpop<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn lpush<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn mlpush<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, values: Vec<V>) -> Result<R, RedisError>

fn lpushx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn lrange<R: From<RedisResult>, K: ToString>(&mut self, key: K, start: i32, end: i32) -> Result<R, RedisError>

fn lrem<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, count: i32, value: V) -> Result<R, RedisError>

fn lset<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, index: i32, value: V) -> Result<R, RedisError>

fn ltrim<R: From<RedisResult>, K: ToString>(&mut self, key: K, start: i32, end: i32) -> Result<R, RedisError>

fn multi<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn rename<R: From<RedisResult>, K: ToString, N: ToString>(&mut self, key: K, new_key: N) -> Result<R, RedisError>

fn renamenx<R: From<RedisResult>, K: ToString, N: ToString>(&mut self, key: K, new_key: N) -> Result<R, RedisError>

fn rpop<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn rpoplpush<R: From<RedisResult>, S: ToString, D: ToString>(&mut self, source: S, dest: D) -> Result<R, RedisError>

fn rpush<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn mrpush<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, values: Vec<V>) -> Result<R, RedisError>

fn rpushx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn sadd<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, member: M) -> Result<R, RedisError>

fn msadd<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, members: Vec<M>) -> Result<R, RedisError>

fn sadd_binary<R: From<RedisResult>, K: ToString>(&mut self, key: K, member: &[u8]) -> Result<R, RedisError>

fn scard<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn select<R: From<RedisResult>>(&mut self, db_index: i32) -> Result<R, RedisError>

fn set<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn set_binary<R: From<RedisResult>, K: ToString>(&mut self, key: K, value: &[u8]) -> Result<R, RedisError>

fn setex<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn psetex<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn setnx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn setxx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V) -> Result<R, RedisError>

fn setex_nx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn setex_xx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn psetex_nx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn psetex_xx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, value: V, expiry: i64) -> Result<R, RedisError>

fn setbit<R: From<RedisResult>, K: ToString>(&mut self, key: K, offset: u32, bit: u8) -> Result<R, RedisError>

fn setrange<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, offset: u32, value: V) -> Result<R, RedisError>

fn sismember<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, member: M) -> Result<R, RedisError>

fn smembers<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn spop<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn spop_count<R: From<RedisResult>, K: ToString>(&mut self, key: K, count: u32) -> Result<R, RedisError>

fn srem<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, member: M) -> Result<R, RedisError>

fn msrem<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, members: Vec<M>) -> Result<R, RedisError>

fn strlen<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn ttl<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn unwatch<R: From<RedisResult>>(&mut self) -> Result<R, RedisError>

fn watch<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn mwatch<R: From<RedisResult>, K: ToString>(&mut self, keys: Vec<K>) -> Result<R, RedisError>

fn zadd<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, score: f64, member: V) -> Result<R, RedisError>

fn zadd_binary<R: From<RedisResult>, K: ToString>(&mut self, key: K, score: f64, member: &[u8]) -> Result<R, RedisError>

fn zaddnx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, score: f64, member: V) -> Result<R, RedisError>

fn zaddxx<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, score: f64, member: V) -> Result<R, RedisError>

fn zaddnx_ch<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, score: f64, member: V) -> Result<R, RedisError>

fn zaddxx_ch<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, score: f64, member: V) -> Result<R, RedisError>

fn zcard<R: From<RedisResult>, K: ToString>(&mut self, key: K) -> Result<R, RedisError>

fn zcount<R: From<RedisResult>, K: ToString, S: ToString, E: ToString>(&mut self, key: K, start_range: S, end_range: E) -> Result<R, RedisError>

fn zincrby<R: From<RedisResult>, K: ToString, V: ToString>(&mut self, key: K, increment: f64, member: V) -> Result<R, RedisError>

fn zlexcount<R: From<RedisResult>, K: ToString, S: ToString, E: ToString>(&mut self, key: K, min: S, max: E) -> Result<R, RedisError>

fn zrem<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, member: M) -> Result<R, RedisError>

fn mzrem<R: From<RedisResult>, K: ToString, M: ToString>(&mut self, key: K, members: Vec<M>) -> Result<R, RedisError>

fn zrange<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

fn zrange_with_scores<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

fn zrevrange<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

fn zrevrange_with_scores<R: From<RedisResult>, K: ToString>(&mut self, key: K, start_range: i64, end_range: i64) -> Result<R, RedisError>

impl Debug for RedisClient

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for RedisClient

fn fmt(&self, f: &mut Formatter) -> Result