pub struct CacheManager { /* private fields */ }Implementations§
Source§impl CacheManager
impl CacheManager
pub fn new(config: CacheConfig, backend: Box<dyn CacheBackend>) -> Self
pub async fn get<T: DeserializeOwned>( &self, key: &CacheKey, ) -> Result<Option<T>>
pub async fn set<T: Serialize>(&self, key: &CacheKey, value: &T) -> Result<()>
pub async fn set_with_ttl<T: Serialize>( &self, key: &CacheKey, value: &T, ttl: Duration, ) -> Result<()>
pub async fn delete(&self, key: &CacheKey) -> Result<bool>
pub fn stats(&self) -> CacheStats
pub fn backend_name(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for CacheManager
impl !RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl !UnwindSafe for CacheManager
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