pub enum Driver {
Memory(MemoryDriver),
}Expand description
Enum-dispatched driver. Cheap to clone (Arc-backed internals).
Variants§
Memory(MemoryDriver)
Implementations§
Source§impl Driver
impl Driver
pub async fn get(&self, key: &str) -> Result<Option<String>, CacheError>
pub async fn set( &self, key: &str, value: String, ttl: Option<Duration>, ) -> Result<(), CacheError>
pub async fn forget(&self, key: &str) -> Result<(), CacheError>
pub async fn flush(&self) -> Result<(), CacheError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Driver
impl !RefUnwindSafe for Driver
impl Send for Driver
impl Sync for Driver
impl Unpin for Driver
impl UnsafeUnpin for Driver
impl !UnwindSafe for Driver
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