pub struct RedisCache { /* private fields */ }Expand description
Redis cache implementation
Implementations§
Source§impl RedisCache
 
impl RedisCache
pub fn new( _redis_url: &str, default_ttl: Option<Duration>, ) -> Result<Self, Box<dyn Error>>
pub async fn get(&self, _key: &str) -> Result<Option<String>, Box<dyn Error>>
pub async fn set( &self, _key: &str, _value: &str, _ttl: Option<Duration>, ) -> Result<(), Box<dyn Error>>
pub async fn delete(&self, _key: &str) -> Result<bool, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for RedisCache
impl RefUnwindSafe for RedisCache
impl Send for RedisCache
impl Sync for RedisCache
impl Unpin for RedisCache
impl UnwindSafe for RedisCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more