Trait xstack_kad::kbucket::KBucketDistance

source ·
pub trait KBucketDistance {
    // Required method
    fn k_index(&self) -> Option<u32>;
}
Expand description

k-bucket key distance associated type must implement this trait.

Required Methods§

source

fn k_index(&self) -> Option<u32>

Returns the integer part of the base 2 logarithm of the distance.

Returns None if the distance is zero.

Implementors§