pub struct DashMapCache { /* private fields */ }Implementations§
Source§impl DashMapCache
impl DashMapCache
Sourcepub fn new_with_capacity(capacity: usize) -> Self
pub fn new_with_capacity(capacity: usize) -> Self
Create new DashMap cache with capacity limit
Sourcepub fn with_max_capacity(self, capacity: usize) -> Self
pub fn with_max_capacity(self, capacity: usize) -> Self
Set maximum capacity limit
Sourcepub fn cleanup_expired(&self) -> usize
pub fn cleanup_expired(&self) -> usize
Cleanup expired entries
Trait Implementations§
Source§impl CacheBackend for DashMapCache
Implement CacheBackend trait for DashMapCache
impl CacheBackend for DashMapCache
Implement CacheBackend trait for DashMapCache
Source§fn get<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Option<Bytes>>
fn get<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Option<Bytes>>
Get value from cache by key Read more
Source§fn set_with_ttl<'a>(
&'a self,
key: &'a str,
value: Bytes,
ttl: Duration,
) -> BoxFuture<'a, CacheResult<()>>
fn set_with_ttl<'a>( &'a self, key: &'a str, value: Bytes, ttl: Duration, ) -> BoxFuture<'a, CacheResult<()>>
Set value in cache with time-to-live Read more
Source§fn remove<'a>(&'a self, key: &'a str) -> BoxFuture<'a, CacheResult<()>>
fn remove<'a>(&'a self, key: &'a str) -> BoxFuture<'a, CacheResult<()>>
Remove value from cache Read more
Source§fn remove_pattern<'a>(
&'a self,
pattern: &'a str,
) -> BoxFuture<'a, CacheResult<()>>
fn remove_pattern<'a>( &'a self, pattern: &'a str, ) -> BoxFuture<'a, CacheResult<()>>
Remove keys matching a pattern Read more
Source§impl Default for DashMapCache
impl Default for DashMapCache
Source§impl L2CacheBackend for DashMapCache
impl L2CacheBackend for DashMapCache
Auto Trait Implementations§
impl !RefUnwindSafe for DashMapCache
impl !UnwindSafe for DashMapCache
impl Freeze for DashMapCache
impl Send for DashMapCache
impl Sync for DashMapCache
impl Unpin for DashMapCache
impl UnsafeUnpin for DashMapCache
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