Trait sc_network::multiaddr::multihash::Digest [−]
pub trait Digest<S>: 'static + AsRef<[u8]> + AsMut<[u8]> + From<GenericArray<u8, S>> + Into<GenericArray<u8, S>> + Clone + Hash + Debug + Default + Eq + Send + Sync where
S: Size, { fn size(&self) -> u8 { ... } fn wrap(digest: &[u8]) -> Result<Self, Error> { ... } fn from_reader<R>(r: R) -> Result<Self, Error>
where
R: Read, { ... } }
Expand description
Stack allocated digest trait.
Provided methods
fn from_reader<R>(r: R) -> Result<Self, Error> where
R: Read,
fn from_reader<R>(r: R) -> Result<Self, Error> where
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 Blake2bDigest<S> where
S: Size,
impl<S> Digest<S> for Blake2sDigest<S> where
S: Size,
impl<S> Digest<S> for Blake3Digest<S> where
S: Size,
impl<S> Digest<S> for IdentityDigest<S> where
S: Size,
impl<S> Digest<S> for KeccakDigest<S> where
S: Size,
impl<S> Digest<S> for Sha2Digest<S> where
S: Size,
impl<S> Digest<S> for Sha3Digest<S> where
S: Size,
impl<S> Digest<S> for UnknownDigest<S> where
S: Size,