use crate::bloom_sol::struct_def::CountingBloomFilter;
use std::hash::Hash;
impl CountingBloomFilter {
/// Checks if an item might be in the filter.
///
/// Returns `true` if the item is possibly present (may be false positive), `false` if definitely not present.
pub fn contains<T: Hash>(&self, item: &T) -> bool {
self.get_hash_indices(item)
.iter()
.all(|&index| self.counters[index] > 0)
}
}