pub struct Ibf { /* private fields */ }Expand description
A fixed-width Invertible Bloom Filter over u64 hash values.
k hash functions are simulated by rotating a seed before each cell
selection. For PSync, set elements are hashes of NDN name strings.
Implementations§
Source§impl Ibf
impl Ibf
Sourcepub fn from_cells(cells: Vec<(u64, u64, i64)>) -> Self
pub fn from_cells(cells: Vec<(u64, u64, i64)>) -> Self
Create an IBF from raw cell data (xor_sum, hash_sum, count).
Uses k = 3 hash functions (the PSync default). The number of cells
is inferred from the length of cells.
Sourcepub fn cells(&self) -> Vec<(u64, u64, i64)>
pub fn cells(&self) -> Vec<(u64, u64, i64)>
Export cells as (xor_sum, hash_sum, count) tuples for wire encoding.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ibf
impl RefUnwindSafe for Ibf
impl Send for Ibf
impl Sync for Ibf
impl Unpin for Ibf
impl UnwindSafe for Ibf
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