Struct redis::InfoDict [] [src]

pub struct InfoDict {
    // some fields omitted
}

An info dictionary type.

Methods

impl InfoDict

This type provides convenient access to key/value data returned by the "INFO" command. It acts like a regular mapping but also has a convenience method get which can return data in the appropriate type.

For instance this can be used to query the server for the role it's in (master, slave) etc:

let info : redis::InfoDict = try!(redis::cmd("INFO").query(&con));
let role : Option<String> = info.get("role");

fn new(kvpairs: &str) -> InfoDict

Creates a new info dictionary from a string in the response of the INFO command. Each line is a key, value pair with the key and value separated by a colon (:). Lines starting with a hash (#) are ignored.

fn get<T: FromRedisValue>(&self, key: &str) -> Option<T>

Fetches a value by key and converts it into the given type. Typical types are String, bool and integer types.

fn find(&self, key: &&str) -> Option<&Value>

fn contains_key(&self, key: &&str) -> bool

fn len(&self) -> usize

Trait Implementations

impl FromRedisValue for InfoDict

fn from_redis_value(v: &Value) -> RedisResult<InfoDict>

fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>