[][src]Struct blockhash::Blockhash16

pub struct Blockhash16(_);

A 16-bit hash digest.

Implementations

impl Blockhash16[src]

pub fn distance(&self, other: &Self) -> u32[src]

Returns the Hamming distance between two hashes.

Examples

use blockhash::Blockhash16;

let a = Blockhash16::from([0xff, 0x80]);
let b = Blockhash16::from([0xf7, 0xc1]);

assert_eq!(a.distance(&b), 3);

Trait Implementations

impl Clone for Blockhash16[src]

impl Copy for Blockhash16[src]

impl Debug for Blockhash16[src]

impl Display for Blockhash16[src]

impl Eq for Blockhash16[src]

impl From<[u8; 2]> for Blockhash16[src]

impl From<Blockhash16> for [u8; 2][src]

impl From<Blockhash16> for u16[src]

impl From<u16> for Blockhash16[src]

impl FromStr for Blockhash16[src]

type Err = BlockhashParseError

The associated error which can be returned from parsing.

impl Hash for Blockhash16[src]

impl Ord for Blockhash16[src]

impl PartialEq<Blockhash16> for Blockhash16[src]

impl PartialOrd<Blockhash16> for Blockhash16[src]

impl StructuralEq for Blockhash16[src]

impl StructuralPartialEq for Blockhash16[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.