pub struct BloomFilter { /* private fields */ }Expand description
A proper Bloom Filter implementation using a bit vector for memory efficiency. This is used for efficiently checking if a URL has potentially been visited before, reducing the need for expensive lookups in the main visited URLs cache.
Implementations§
Source§impl BloomFilter
impl BloomFilter
Sourcepub fn new(num_bits: u64, hash_functions: usize) -> Self
pub fn new(num_bits: u64, hash_functions: usize) -> Self
Creates a new BloomFilter with the specified capacity and number of hash functions.
Sourcepub fn might_contain(&self, item: &str) -> bool
pub fn might_contain(&self, item: &str) -> bool
Checks if an item might be in the BloomFilter. Returns true if the item might be in the set, false if it definitely isn’t.
Auto Trait Implementations§
impl Freeze for BloomFilter
impl RefUnwindSafe for BloomFilter
impl Send for BloomFilter
impl Sync for BloomFilter
impl Unpin for BloomFilter
impl UnsafeUnpin for BloomFilter
impl UnwindSafe for BloomFilter
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