[−][src]Trait libp2p::kad::kbucket::KBucketsPeerId
Trait that must be implemented on types that can be used as an identifier in a k-bucket.
If TOther
is not the same as Self
, it represents an entry already in the k-buckets that
Self
can compare against.
Required methods
fn distance_with(&self, other: &TOther) -> u32
Computes the XOR of this value and another one. The lower the closer.
fn max_distance() -> NonZeroUsize
Returns then number of bits that are necessary to store the distance between peer IDs. Used for pre-allocations.
Implementations on Foreign Types
impl<A, B> KBucketsPeerId<(A, B)> for (A, B) where
A: KBucketsPeerId<A> + PartialEq<A>,
B: KBucketsPeerId<B> + PartialEq<B>,
[src]
A: KBucketsPeerId<A> + PartialEq<A>,
B: KBucketsPeerId<B> + PartialEq<B>,
fn distance_with(&self, other: &(A, B)) -> u32
[src]
fn max_distance() -> NonZeroUsize
[src]
impl<'a, T> KBucketsPeerId<&'a T> for &'a T where
T: KBucketsPeerId<T>,
[src]
T: KBucketsPeerId<T>,