[]Struct sc_network::multiaddr::multihash::MultihashRef

pub struct MultihashRef<'a> { /* fields omitted */ }

Represents a valid multihash.

Methods

impl<'a> MultihashRef<'a>

pub fn from_slice(input: &'a [u8]) -> Result<MultihashRef<'a>, DecodeError>

Creates a MultihashRef from the given input.

pub fn algorithm(&self) -> Hash

Returns which hashing algorithm is used in this multihash.

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

Returns the hashed data.

pub fn into_owned(self) -> Multihash

Builds a Multihash that owns the data.

This operation allocates.

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

Returns the bytes representation of this multihash.

Trait Implementations

impl<'a> Clone for MultihashRef<'a>

impl<'a> Copy for MultihashRef<'a>

impl<'a> Debug for MultihashRef<'a>

impl<'a> Eq for MultihashRef<'a>

impl<'a> Hash for MultihashRef<'a>

impl<'a> PartialEq<Multihash> for MultihashRef<'a>

impl<'a> PartialEq<MultihashRef<'a>> for MultihashRef<'a>

impl<'a> PartialEq<MultihashRef<'a>> for Multihash

impl<'a> StructuralEq for MultihashRef<'a>

impl<'a> StructuralPartialEq for MultihashRef<'a>

Auto Trait Implementations

impl<'a> RefUnwindSafe for MultihashRef<'a>

impl<'a> Send for MultihashRef<'a>

impl<'a> Sync for MultihashRef<'a>

impl<'a> Unpin for MultihashRef<'a>

impl<'a> UnwindSafe for MultihashRef<'a>

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> CheckedConversion for T[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeHash for T where
    T: Hash
[src]

impl<T> MaybeHash for T where
    T: Hash

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,