Trait kad::common::id::DatabaseId[][src]

pub trait DatabaseId: Hash + Default + PartialEq + Eq + Ord + Clone + Send + Debug {
    fn xor(a: &Self, b: &Self) -> Self;
fn bits(&self) -> usize;
fn is_zero(&self) -> bool;
fn max_bits(&self) -> usize; }
Expand description

Id trait must be implemented for viable id types

Required methods

Exclusive or two IDs to calculate distance

Calculate number of bits to express a given ID

Check if a hash is zero

Bit length of the ID type

Implementors