pub struct DuplicateCache<const N: usize = 64> { /* private fields */ }Expand description
Fixed-capacity cache of recently observed duplicate keys.
Implementations§
Source§impl<const N: usize> DuplicateCache<N>
impl<const N: usize> DuplicateCache<N>
Sourcepub fn contains(&self, key: &DupCacheKey) -> bool
pub fn contains(&self, key: &DupCacheKey) -> bool
Return whether key is already present.
Sourcepub fn insert(&mut self, key: DupCacheKey, now_ms: u64)
pub fn insert(&mut self, key: DupCacheKey, now_ms: u64)
Insert key, evicting the oldest entry if necessary.
Trait Implementations§
Source§impl<const N: usize> Clone for DuplicateCache<N>
impl<const N: usize> Clone for DuplicateCache<N>
Source§fn clone(&self) -> DuplicateCache<N>
fn clone(&self) -> DuplicateCache<N>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const N: usize> Debug for DuplicateCache<N>
impl<const N: usize> Debug for DuplicateCache<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for DuplicateCache<N>
impl<const N: usize> RefUnwindSafe for DuplicateCache<N>
impl<const N: usize> Send for DuplicateCache<N>
impl<const N: usize> Sync for DuplicateCache<N>
impl<const N: usize> Unpin for DuplicateCache<N>
impl<const N: usize> UnwindSafe for DuplicateCache<N>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)