[−][src]Struct shorty::redis_facade::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]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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.