[][src]Struct trezm_redis::InfoDict

pub struct InfoDict { /* fields omitted */ }

An info dictionary type.


impl InfoDict[src]

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 = redis::cmd("INFO").query(&mut con)?;
let role : Option<String> = info.get("role");

pub fn new(kvpairs: &str) -> InfoDict[src]

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.

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

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

pub fn find(&self, key: &&str) -> Option<&Value>[src]

Looks up a key in the info dict.

pub fn contains_key(&self, key: &&str) -> bool[src]

Checks if a key is contained in the info dicf.

pub fn len(&self) -> usize[src]

Returns the size of the info dict.

pub fn is_empty(&self) -> bool[src]

Checks if the dict is empty.

Trait Implementations

impl Debug for InfoDict[src]

impl FromRedisValue for InfoDict[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,