[−][src]Struct redis::InfoDict
An info dictionary type.
Methods
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 FromRedisValue for InfoDict[src]
fn from_redis_value(v: &Value) -> RedisResult<InfoDict>[src]
fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>[src]
impl Debug for InfoDict[src]
Auto Trait Implementations
impl Send for InfoDict
impl Sync for InfoDict
impl Unpin for InfoDict
impl UnwindSafe for InfoDict
impl RefUnwindSafe for InfoDict
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,