pub trait Digest<S: Size>:
AsRef<[u8]>
+ AsMut<[u8]>
+ From<GenericArray<u8, S>>
+ Into<GenericArray<u8, S>>
+ Clone
+ Hash
+ Debug
+ Default
+ Eq
+ Send
+ Sync
+ 'static {
// Provided methods
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§
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.