pub struct CacheManager { /* private fields */ }Implementations§
Source§impl CacheManager
impl CacheManager
pub fn new(options: CacheManagerOptions) -> Self
pub fn with_stores( options: CacheManagerOptions, stores: Vec<Arc<dyn KeyvStoreAdapter>>, ) -> Self
pub async fn get( &self, key: &str, ) -> Result<Option<CacheValue>, CacheManagerError>
pub async fn set<T: Serialize + Send + Sync>( &self, key: &str, value: T, ttl: Option<u64>, ) -> Result<(), CacheManagerError>
pub async fn set_value( &self, key: &str, value: CacheValue, ttl: Option<Duration>, ) -> Result<(), CacheManagerError>
pub async fn del(&self, key: &str) -> Result<bool, CacheManagerError>
pub async fn reset(&self) -> Result<(), CacheManagerError>
pub async fn onModuleDestroy(&self) -> Result<(), CacheManagerError>
pub fn options(&self) -> &CacheManagerOptions
Trait Implementations§
Source§impl Clone for CacheManager
impl Clone for CacheManager
Source§fn clone(&self) -> CacheManager
fn clone(&self) -> CacheManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CacheManager
impl !RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl UnsafeUnpin 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