Trait HammingDistance

Source
pub trait HammingDistance<RHS = Self> {
    // Required method
    fn hamming_distance(self, other: RHS) -> u64;
}
Expand description

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

Required Methods§

Source

fn hamming_distance(self, other: RHS) -> u64

Implementations on Foreign Types§

Source§

impl HammingDistance for u8

Source§

fn hamming_distance(self, other: u8) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl HammingDistance for u16

Source§

fn hamming_distance(self, other: u16) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl HammingDistance for u32

Source§

fn hamming_distance(self, other: u32) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl HammingDistance for u64

Source§

fn hamming_distance(self, other: u64) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl HammingDistance for u128

Source§

fn hamming_distance(self, other: u128) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl HammingDistance for usize

Source§

fn hamming_distance(self, other: usize) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§