pub trait Hashed:
Display
+ Debug
+ Sized
+ Eq
+ PartialEq {
Show 16 methods
// Required methods
fn as_slice(&self) -> &[u8] ⓘ;
fn from_slice(hash: &[u8]) -> Result<Self>;
fn from_byte_array(hash: ByteArray) -> Result<Self>;
fn function() -> Function;
fn digest_slice(msg: &[u8]) -> Arc<[u8]>;
fn named(self, name: impl Into<Cow<'static, str>>) -> Self;
fn as_byte_array(&self) -> &ByteArray;
fn into_byte_array(self) -> ByteArray;
// Provided methods
fn digest(msg: impl Into<ByteArray>) -> Self { ... }
fn from_hex_le(s: &str) -> Result<Self> { ... }
fn from_hex_be(s: &str) -> Result<Self> { ... }
fn from_slice_le(hash_le: &[u8]) -> Result<Self> { ... }
fn to_vec_le(&self) -> Vec<u8> ⓘ { ... }
fn to_hex_le(&self) -> String { ... }
fn to_hex_be(&self) -> String { ... }
fn concat(self, other: impl Into<ByteArray>) -> ByteArray { ... }
}Required Methods§
fn as_slice(&self) -> &[u8] ⓘ
fn from_slice(hash: &[u8]) -> Result<Self>
fn from_byte_array(hash: ByteArray) -> Result<Self>
fn function() -> Function
fn digest_slice(msg: &[u8]) -> Arc<[u8]>
fn named(self, name: impl Into<Cow<'static, str>>) -> Self
fn as_byte_array(&self) -> &ByteArray
fn into_byte_array(self) -> ByteArray
Provided Methods§
fn digest(msg: impl Into<ByteArray>) -> Self
fn from_hex_le(s: &str) -> Result<Self>
fn from_hex_be(s: &str) -> Result<Self>
fn from_slice_le(hash_le: &[u8]) -> Result<Self>
fn to_vec_le(&self) -> Vec<u8> ⓘ
fn to_hex_le(&self) -> String
fn to_hex_be(&self) -> String
fn concat(self, other: impl Into<ByteArray>) -> ByteArray
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.