pub struct OptionCache { /* private fields */ }Expand description
Cache that stores optional values (present or absent).
Implementations§
Source§impl OptionCache
impl OptionCache
pub fn new() -> Self
pub fn set_some(&mut self, key: &str, value: &str)
pub fn set_none(&mut self, key: &str)
pub fn get(&mut self, key: &str) -> Option<Option<&str>>
pub fn has_key(&self, key: &str) -> bool
pub fn remove(&mut self, key: &str) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn hits(&self) -> u64
pub fn misses(&self) -> u64
pub fn hit_rate(&self) -> f32
pub fn clear(&mut self)
pub fn present_count(&self) -> usize
pub fn absent_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptionCache
impl RefUnwindSafe for OptionCache
impl Send for OptionCache
impl Sync for OptionCache
impl Unpin for OptionCache
impl UnsafeUnpin for OptionCache
impl UnwindSafe for OptionCache
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