[][src]Struct blockhash::Blockhash64

pub struct Blockhash64(_);

A 64-bit hash digest.

Implementations

impl Blockhash64[src]

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

Returns the Hamming distance between two hashes.

Examples

use blockhash::Blockhash64;

let a = Blockhash64::from([
    0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef,
]);
let b = Blockhash64::from([
    0xd0, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xff,
]);

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

Trait Implementations

impl Clone for Blockhash64[src]

impl Copy for Blockhash64[src]

impl Debug for Blockhash64[src]

impl Display for Blockhash64[src]

impl Eq for Blockhash64[src]

impl From<[u8; 8]> for Blockhash64[src]

impl From<Blockhash64> for [u8; 8][src]

impl From<Blockhash64> for u64[src]

impl From<u64> for Blockhash64[src]

impl FromStr for Blockhash64[src]

type Err = BlockhashParseError

The associated error which can be returned from parsing.

impl Hash for Blockhash64[src]

impl Ord for Blockhash64[src]

impl PartialEq<Blockhash64> for Blockhash64[src]

impl PartialOrd<Blockhash64> for Blockhash64[src]

impl StructuralEq for Blockhash64[src]

impl StructuralPartialEq for Blockhash64[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.