pub struct PSyncNode { /* private fields */ }Expand description
Partial Sync (PSync) node.
Maintains a local set of content name hashes and an IBF over that set.
To reconcile with a peer: compute local_ibf.subtract(peer_ibf) and
call decode() to find which hashes each side is missing.
Implementations§
Source§impl PSyncNode
impl PSyncNode
Sourcepub fn new(ibf_size: usize) -> Self
pub fn new(ibf_size: usize) -> Self
Create a node with an IBF of ibf_size cells and k=3 hash functions.
ibf_size should be significantly larger than the expected set
difference; 80 cells handles differences up to ~40 elements with k=3.
Auto Trait Implementations§
impl Freeze for PSyncNode
impl RefUnwindSafe for PSyncNode
impl Send for PSyncNode
impl Sync for PSyncNode
impl Unpin for PSyncNode
impl UnwindSafe for PSyncNode
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