pub trait BinaryEncodable {
// Required method
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>;
}Expand description
Trait for types that can be binary encoded for hashing
Required Methods§
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl BinaryEncodable for &[u8]
impl BinaryEncodable for &[u8]
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for &str
impl BinaryEncodable for &str
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for String
impl BinaryEncodable for String
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for Vec<u8>
impl BinaryEncodable for Vec<u8>
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for [u8; 32]
impl BinaryEncodable for [u8; 32]
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for bool
impl BinaryEncodable for bool
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for i64
impl BinaryEncodable for i64
fn encode_binary(&self) -> Result<Vec<u8>, EncodingError>
Source§impl BinaryEncodable for u64
Implementation for basic types
impl BinaryEncodable for u64
Implementation for basic types