[−]Struct ssb_publish::Multihash
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,
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
fn clone(&self) -> Multihash
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl StructuralEq for Multihash
impl PartialOrd<Multihash> for Multihash
fn partial_cmp(&self, other: &Multihash) -> Option<Ordering>
fn lt(&self, other: &Multihash) -> bool
fn le(&self, other: &Multihash) -> bool
fn gt(&self, other: &Multihash) -> bool
fn ge(&self, other: &Multihash) -> bool
impl Eq for Multihash
impl Debug for Multihash
impl StructuralPartialEq for Multihash
impl Hash for Multihash
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'de> Deserialize<'de> for Multihash
fn deserialize<D>(
deserializer: D
) -> Result<Multihash, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
deserializer: D
) -> Result<Multihash, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Serialize for Multihash
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
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]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,