pub struct QuotientFilter { /* private fields */ }Implementations§
Source§impl QuotientFilter
impl QuotientFilter
Sourcepub fn new(quotient_size: u8) -> Result<Self>
pub fn new(quotient_size: u8) -> Result<Self>
Creates a new filter. Quotient size defines the size, ex. quotient_size = 2, size of table is 2^2 = 4 And 64 - 2 = 62 rest of the bits will be used for remainder
Sourcepub fn insert_value(&mut self, value: &[u8]) -> Result<usize>
pub fn insert_value(&mut self, value: &[u8]) -> Result<usize>
Inserts byte-value using fnv1a
Sourcepub fn lookup_value(&mut self, value: &[u8]) -> bool
pub fn lookup_value(&mut self, value: &[u8]) -> bool
Reads byte-value using fnv1a
Sourcepub fn delete_value(&mut self, value: &[u8])
pub fn delete_value(&mut self, value: &[u8])
Deleted byte-value using fnv1a
Sourcepub fn merge(&mut self, other: &QuotientFilter) -> Result<()>
pub fn merge(&mut self, other: &QuotientFilter) -> Result<()>
Merges a second filter into original one and doubles its original size. They have to have the same size.
Sourcepub fn lookup(&mut self, fingerprint: u64) -> bool
pub fn lookup(&mut self, fingerprint: u64) -> bool
Returns if the element exists, by using custom fingerprint
pub fn delete(&mut self, fingerprint: u64)
Sourcepub fn insert(&mut self, fingerprint: u64) -> Result<usize>
pub fn insert(&mut self, fingerprint: u64) -> Result<usize>
Inserts the element by using custom fingerprint and returns the index
pub fn get_index(&self, fingerprint: u64) -> Option<usize>
Auto Trait Implementations§
impl Freeze for QuotientFilter
impl RefUnwindSafe for QuotientFilter
impl Send for QuotientFilter
impl Sync for QuotientFilter
impl Unpin for QuotientFilter
impl UnwindSafe for QuotientFilter
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