pub struct Cache { /* private fields */ }Implementations§
Source§impl Cache
impl Cache
pub fn new(driver: Box<dyn CacheDriver>, config: Cache) -> Self
pub fn try_from_config(config: Cache) -> CacheResult<Self>
pub fn config(self) -> Cache
pub async fn has(&self, key: &str) -> CacheResult<bool>
pub async fn get(&self, key: &str) -> CacheResult<Option<String>>
pub async fn insert(&self, key: &str, value: &str) -> CacheResult<()>
pub async fn remove(&self, key: &str) -> CacheResult<()>
pub async fn clear(&self) -> CacheResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cache
impl !RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl !UnwindSafe for Cache
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