Trait tetsy_libp2p::multihash::Digest [−]
Stack allocated digest trait.
Provided methods
pub fn size(&self) -> u8
Size of the digest.
pub fn wrap(digest: &[u8]) -> Result<Self, Error>
Wraps the digest bytes.
pub fn from_reader<R>(r: R) -> Result<Self, Error> where
R: Read,
R: Read,
Reads a multihash digest from a byte stream that contains the digest prefixed with the size.
The byte stream must not contain the code as prefix.
Implementors
impl<S> Digest<S> for IdentityDigest<S> where
S: Size,
S: Size,
pub fn size(&self) -> u8
pub fn wrap(digest: &[u8]) -> Result<IdentityDigest<S>, Error>
pub fn from_reader<R>(r: R) -> Result<IdentityDigest<S>, Error> where
R: Read,
R: Read,
impl<S> Digest<S> for Sha2Digest<S> where
S: Size,
S: Size,
impl<S> Digest<S> for UnknownDigest<S> where
S: Size,
S: Size,