[]Struct ssb_publish::Multihash

pub struct Multihash(pub Target, _);

A multihash that owns its data.

Methods

impl Multihash

pub fn from_sha256(digest: [u8; 32], target: Target) -> Multihash

Take a sha256 digest and turn it into an opaque Multihash.

pub fn from_legacy(s: &[u8]) -> Result<(Multihash, &[u8]), DecodeLegacyError>

Parses a legacy encoding into a Multihash.

pub fn to_legacy<W>(&self, w: &mut W) -> Result<(), Error> where
    W: Write

Serialize a Multihash into a writer, using the legacy encoding.

pub fn to_legacy_vec(&self) -> Vec<u8>

Serialize a Multihash into an owned byte vector, using the legacy encoding.

pub fn to_legacy_string(&self) -> String

Serialize a Multihash into an owned string, using the legacy encoding.

Trait Implementations

impl Clone for Multihash

impl StructuralEq for Multihash

impl PartialOrd<Multihash> for Multihash

impl Eq for Multihash

impl Debug for Multihash

impl StructuralPartialEq for Multihash

impl Hash for Multihash

impl<'de> Deserialize<'de> for Multihash

impl Serialize for Multihash

impl PartialEq<Multihash> for Multihash

impl Ord for Multihash

Auto Trait Implementations

impl Send for Multihash

impl Sync for Multihash

impl Unpin for Multihash

impl UnwindSafe for Multihash

impl RefUnwindSafe for Multihash

Blanket Implementations

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

impl<T> From<T> for T[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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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