pub fn check_and_set(&mut self, item: &T) -> bool
        where
        T: Hash,
        {
            let mut hashes = [0u64, 0u64];
            let mut found = true;
            for k_i in 0..self.k_num {
                let bit_offset = (self.bloom_hash(&mut hashes, &item, k_i) % self.bitmap_bits) as usize;
                if self.bitmap.get(bit_offset).unwrap() == false {
                    found = false;
                    self.bitmap.set(bit_offset, true);
                }
            }
            found
        }
/// Record the presence of an item in the set,
/// and return the previous state of this item.
Record the presence of an item in the set,
and return the previous state of this item.
Record the presence of an item in the set and return the previous state of this item .
pub fn check_and_set(&mut self, item: &T) -> bool
        where
        T: Hash,
        {
            let mut hashes = [0u64, 0u64];
            let mut found = true;
            for k_i in 0..self.k_num {
                let bit_offset = (self.bloom_hash(&mut hashes, &item, k_i) % self.bitmap_bits) as usize;
                if self.bitmap.get(bit_offset).unwrap() == false {
                    found = false;
                    self.bitmap.set(bit_offset, true);
                }
            }
            found
        }
pub fn check_and_set ( & mut self , item : & T ) -> bool where T : Hash , { let mut hashes = [ 0u64 , 0u64 ] ; let mut found = true ; for k_i in 0 .. self . k_num { let bit_offset = ( self . bloom_hash ( & mut hashes , & item , k_i ) % self . bitmap_bits ) as usize ; if self . bitmap . get ( bit_offset ) . unwrap ( ) == false { found = false ; self . bitmap . set ( bit_offset , true ) ; } } found }
Record the presence of an item in the set,
and return the previous state of this item.
Record the presence of an item in the set and return the previous state of this item .
&mut self
item
&T
&mut self
item
&T