pub enum Multihash {
Message([u8; 32]),
Blob([u8; 32]),
}Expand description
A multihash that owns its data.
Variants§
Implementations§
Source§impl Multihash
impl Multihash
Sourcepub fn from_legacy(s: &[u8]) -> Result<(Multihash, &[u8]), DecodeLegacyError>
pub fn from_legacy(s: &[u8]) -> Result<(Multihash, &[u8]), DecodeLegacyError>
Parses a
legacy encoding
into a Multihash.
Sourcepub fn to_legacy<W: Write>(&self, w: &mut W) -> Result<(), Error>
pub fn to_legacy<W: Write>(&self, w: &mut W) -> Result<(), Error>
Serialize a Multihash into a writer, using the
legacy encoding.
Sourcepub fn to_legacy_vec(&self) -> Vec<u8> ⓘ
pub fn to_legacy_vec(&self) -> Vec<u8> ⓘ
Serialize a Multihash into an owned byte vector, using the
legacy encoding.
Sourcepub fn to_legacy_string(&self) -> String
pub fn to_legacy_string(&self) -> String
Serialize a Multihash into an owned string, using the
legacy encoding.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Multihash
impl<'de> Deserialize<'de> for Multihash
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Multihash
impl Ord for Multihash
Source§impl PartialOrd for Multihash
impl PartialOrd for Multihash
impl Eq for Multihash
impl StructuralPartialEq for Multihash
Auto Trait Implementations§
impl Freeze for Multihash
impl RefUnwindSafe for Multihash
impl Send for Multihash
impl Sync for Multihash
impl Unpin for Multihash
impl UnwindSafe for Multihash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more