pub trait KBucketsPeerId: Eq + Clone {
    fn distance_with(&self, other: &Self) -> u32;
    fn max_distance() -> usize;
}
Expand description

Trait that must be implemented on types that can be used as an identifier in a k-bucket.

Required Methods

Computes the XOR of this value and another one. The lower the closer.

Returns then number of bits that are necessary to store the distance between peer IDs. Used for pre-allocations.

Note: Returning 0 would lead to a panic.

Implementations on Foreign Types

Implementors