[][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.

Methods

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

impl Send for RedisFacade

impl !Sync for RedisFacade

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> Erased for T