pub trait IsHash:
Sized
+ AsRef<[u8]>
+ From<Hash>
+ Into<Hash>
+ AsRef<Hash> {
// Provided methods
fn as_bytes(&self) -> &[u8; 32] { ... }
fn as_slice(&self) -> &[u8] ⓘ { ... }
fn as_hash(&self) -> &Hash { ... }
fn into_bytes(self) -> [u8; 32] { ... }
fn into_hash(self) -> Hash { ... }
fn from_bytes(bytes: [u8; 32]) -> Self { ... }
fn from_hash(hash: Hash) -> Self { ... }
}
Provided Methods§
fn as_bytes(&self) -> &[u8; 32]
fn as_slice(&self) -> &[u8] ⓘ
fn as_hash(&self) -> &Hash
fn into_bytes(self) -> [u8; 32]
fn into_hash(self) -> Hash
fn from_bytes(bytes: [u8; 32]) -> Self
fn from_hash(hash: Hash) -> Self
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.