[][src]Struct parity_multihash::Multihash

pub struct Multihash { /* fields omitted */ }

Represents a valid multihash.

Methods

impl Multihash[src]

pub fn from_bytes(bytes: Vec<u8>) -> Result<Multihash, DecodeOwnedError>[src]

Verifies whether bytes contains a valid multihash, and if so returns a Multihash.

pub fn random(hash: Hash) -> Multihash[src]

Generates a random Multihash from a cryptographically secure PRNG.

pub fn into_bytes(self) -> Vec<u8>[src]

Returns the bytes representation of the multihash.

pub fn to_vec(&self) -> Vec<u8>[src]

Returns the bytes representation of the multihash.

pub fn as_bytes(&self) -> &[u8][src]

Returns the bytes representation of this multihash.

pub fn as_ref(&self) -> MultihashRef[src]

Builds a MultihashRef corresponding to this Multihash.

pub fn algorithm(&self) -> Hash[src]

Returns which hashing algorithm is used in this multihash.

pub fn digest(&self) -> &[u8][src]

Returns the hashed data.

Trait Implementations

impl Clone for Multihash[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl AsRef<[u8]> for Multihash[src]

impl PartialEq<Multihash> for Multihash[src]

impl<'a> PartialEq<MultihashRef<'a>> for Multihash[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'a> PartialEq<Multihash> for MultihashRef<'a>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Eq for Multihash[src]

impl Debug for Multihash[src]

impl Hash for Multihash[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl TryFrom<Vec<u8>> for Multihash[src]

type Error = DecodeOwnedError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self