[][src]Struct shorty::redis_facade::RedisFacade

pub struct RedisFacade(_);

RedisFacade is a wrapper around a redis Connection. It provides convenience methods such as get_string and get_bool which otherwise would be coded as get::<_, String> and get::<_, bool>, making it harder to stub the struct and properly test shorty.

Implementations

impl RedisFacade[src]

pub fn new(redis: Connection) -> RedisFacade[src]

Creates a new RedisFacade, owning an active redis Connection

pub fn get_string(&self, key: &str) -> RedisResult<String>[src]

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

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

pub fn increment(&self, key: &str) -> RedisResult<i64>[src]

pub fn expire(&self, key: &str, period: usize) -> RedisResult<()>[src]

pub fn set(&self, key: &str, value: &str) -> RedisResult<()>[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.