pub struct KBucket {}Implementations§
Source§impl KBucket
impl KBucket
Sourcepub fn arbiter(&self)
pub fn arbiter(&self)
Default arbiter function for contacts with the same id. Uses contact.vectorClock to select which contact to update the k-bucket with. Contact with larger vectorClock field will be selected. If vectorClock is the same, candidat will be selected.
Sourcepub fn distance(&self)
pub fn distance(&self)
Default distance function. Finds the XOR distance between firstId and secondId.
Sourcepub fn closest(&self)
pub fn closest(&self)
Get the n closest contacts to the provided node id. “Closest” here means: closest according to the XOR metric of the contact node id.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for KBucket
impl RefUnwindSafe for KBucket
impl Send for KBucket
impl Sync for KBucket
impl Unpin for KBucket
impl UnsafeUnpin for KBucket
impl UnwindSafe for KBucket
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