pub fn contains_or_insert<H: Hash + ?Sized>(&mut self, key: &H) -> bool {
        let n = if self.filters.len() == 1 {
            1
        } else {
            self.filters.len() - 1
        };

        if self.filters.iter().take(n).any(|f| f.contains(key)) {
            true
        } else {
            !self.insert(key)
        }
    }
/// Adds a value to a Bloom filter if it is not already present.
///
/// When there are > 1 filters, this is only slightly faster than calling both `contains` and
/// `insert`, as the last filter does not have to be checked twice.
///
/// Returns whether the value is (maybe) in the filter or not.
///
/// # Examples
///
/// ```
/// use bbloom::ScalableBloomFilter;
///
/// let mut filter = ScalableBloomFilter::new(0.0001, 64);
///
/// assert!(!filter.contains_or_insert("a"));
/// assert!(!filter.contains_or_insert("b"));
/// assert!(filter.contains_or_insert("b"));
/// ```
Adds a value to a Bloom filter if it is not already present.
When there are > 1 filters, this is only slightly faster than calling both `contains` and
`insert`, as the last filter does not have to be checked twice.

Returns whether the value is (maybe) in the filter or not.
Adds a value to a Bloom filter if it is not already present . When there are > 1 filters this is only slightly faster than calling both ` contains ` and ` insert ` as the last filter does not have to be checked twice . Returns whether the value is ( maybe ) in the filter or not .
pub fn contains_or_insert<H: Hash + ?Sized>(&mut self, key: &H) -> bool {
        let n = if self.filters.len() == 1 {
            1
        } else {
            self.filters.len() - 1
        };
        if self.filters.iter().take(n).any(|f| f.contains(key)) {
            true
        } else {
            !self.insert(key)
        }
    }
pub fn contains_or_insert < H : Hash + ? Sized > ( & mut self , key : & H ) -> bool { let n = if self . filters . len ( ) == 1 { 1 } else { self . filters . len ( ) - 1 } ; if self . filters . iter ( ) . take ( n ) . any ( | f | f . contains ( key ) ) { true } else { ! self . insert ( key ) } }
Adds a value to a Bloom filter if it is not already present.
Adds a value to a Bloom filter if it is not already present .
&mut self
key
&H
&mut self
key
&H
examples
```
use bbloom::ScalableBloomFilter.

let mut filter = ScalableBloomFilter::new(0.0001, 64).


` ` ` use bbloom :: ScalableBloomFilter . let mut filter = ScalableBloomFilter :: new ( 0 . 0001 64 ) .