pub struct HotStore { /* private fields */ }Implementations§
Source§impl HotStore
impl HotStore
pub fn new() -> Self
pub fn with_config(cache_size_mb: usize, _cleanup_interval_secs: u64) -> Self
pub fn new_with_size_limit(max_size_mb: usize) -> Self
pub fn get(&self, key: &str) -> Option<Vec<u8>>
pub fn get_ref(&self, key: &str) -> Option<Arc<Vec<u8>>>
pub fn set(&self, key: String, value: Vec<u8>, ttl: Option<Duration>)
pub fn is_hot(&self, key: &str) -> bool
pub async fn start_cleanup_with_interval(self: Arc<Self>, interval_secs: u64)
pub fn delete(&self, key: &str)
pub fn get_stats(&self) -> CacheStats
pub fn clear(&self)
pub fn hit_ratio(&self) -> f64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HotStore
impl !RefUnwindSafe for HotStore
impl Send for HotStore
impl Sync for HotStore
impl Unpin for HotStore
impl !UnwindSafe for HotStore
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