pub struct MokaCache(pub Cache<String, (Expiration, Vec<u8>)>);Tuple Fields§
§0: Cache<String, (Expiration, Vec<u8>)>Implementations§
Source§impl MokaCache
impl MokaCache
pub fn new_default( callback: Option<fn(Arc<String>, MokaCacheData, RemovalCause)>, max_cap: u64, ) -> MokaCache
pub fn insert<K, V>(&self, key: K, value: V, exp: Expiration) -> Result<()>
pub fn get<K, V>(&self, key: K) -> Option<(Expiration, V)>
pub fn deserialize<V>(d: &[u8]) -> Option<V>
pub fn get_exp<K>(&self, key: K) -> Option<Expiration>
pub fn remove<K>(&self, key: K)
pub fn contains_key<K>(&self, key: K) -> bool
pub fn check_exp_interval(&self)
pub fn refresh<K>(&self, key: K) -> Result<()>
Auto Trait Implementations§
impl Freeze for MokaCache
impl !RefUnwindSafe for MokaCache
impl Send for MokaCache
impl Sync for MokaCache
impl Unpin for MokaCache
impl UnsafeUnpin for MokaCache
impl !UnwindSafe for MokaCache
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