pub struct TtlConfig {
pub ttl: NonZeroU32,
pub ttl_bits: BitCount,
}Expand description
Configuration for the TTL field.
Used to define memory used by the TTL field and the default value.
§Examples
use cuckoo_clock::config::TtlConfig;
let ttl_config = TtlConfig {
ttl: 100.try_into()?,
ttl_bits: 7.try_into()?
};Fields§
§ttl: NonZeroU32The default TTL counter value for newly inserted items. The actual lifetime duration will
be defined by this value combined with the frequency of calls to
crate::CuckooFilter::scan_and_update_full. Each call to
crate::CuckooFilter::scan_and_update_full will reduce the counter by 1, until it
reaches 0, when the item is removed.
ttl_bits: BitCountNumber of bits used to represent the TTL counter. Larget bit counts allow higher TTL to be represented.
Trait Implementations§
impl Eq for TtlConfig
impl StructuralPartialEq for TtlConfig
Auto Trait Implementations§
impl Freeze for TtlConfig
impl RefUnwindSafe for TtlConfig
impl Send for TtlConfig
impl Sync for TtlConfig
impl Unpin for TtlConfig
impl UnsafeUnpin for TtlConfig
impl UnwindSafe for TtlConfig
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