Struct timecat::utils::CacheTable
source · pub struct CacheTable<T: Copy + Clone + PartialEq> { /* private fields */ }Implementations§
source§impl<T: Copy + Clone + PartialEq> CacheTable<T>
impl<T: Copy + Clone + PartialEq> CacheTable<T>
pub fn new(size: CacheTableSize, default: T) -> CacheTable<T>
pub fn get(&self, hash: u64) -> Option<T>
pub fn add(&self, hash: u64, entry: T)
pub fn replace_if<F: Fn(T) -> bool>(&self, hash: u64, entry: T, replace: F)
pub fn clear(&self)
pub const fn get_table(&self) -> &Mutex<Box<[CacheTableEntry<T>]>>
pub fn get_num_overwrites(&self) -> usize
pub fn get_num_collisions(&self) -> usize
pub fn reset_num_overwrites(&self)
pub fn reset_num_collisions(&self)
pub fn reset_variables(&self)
pub fn get_hash_full(&self) -> f64
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_size(&self) -> CacheTableSize
pub fn set_size(&self, size: CacheTableSize)
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for CacheTable<T>
impl<'de, T> Deserialize<'de> for CacheTable<T>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> !Freeze for CacheTable<T>
impl<T> RefUnwindSafe for CacheTable<T>where
T: RefUnwindSafe,
impl<T> Send for CacheTable<T>where
T: Send,
impl<T> Sync for CacheTable<T>
impl<T> Unpin for CacheTable<T>where
T: Unpin,
impl<T> UnwindSafe for CacheTable<T>where
T: UnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more