pub struct Bloom { /* private fields */ }
Implementations§
Source§impl Bloom
impl Bloom
Sourcepub fn add(&mut self, hash: u64)
pub fn add(&mut self, hash: u64)
<— http://www.cse.yorku.ca/~oz/hash.html modified Berkeley DB Hash (32bit) hash is casted to l, h = 16bit fragments func (bl Bloom) absdbm(b *[]byte) (l, h uint64) { hash := uint64(len(*b)) for _, c := range *b { hash = uint64(c) + (hash << 6) + (hash << bl.sizeExp) - hash } h = hash >> bl.shift l = hash << bl.shift >> bl.shift return l, h }
Sourcepub fn add_if_not_has(&mut self, hash: u64) -> bool
pub fn add_if_not_has(&mut self, hash: u64) -> bool
AddIfNotHas only Adds hash, if it’s not present in the bloomfilter. Returns true if hash was added. Returns false if hash was already registered in the bloomfilter.
Auto Trait Implementations§
impl Freeze for Bloom
impl RefUnwindSafe for Bloom
impl Send for Bloom
impl Sync for Bloom
impl Unpin for Bloom
impl UnwindSafe for Bloom
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