pub trait RawBytesEncoding {
// Required methods
fn to_raw_bytes(&self) -> &[u8] ⓘ;
fn from_raw_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>
where Self: Sized;
// Provided methods
fn to_raw_hex(&self) -> String { ... }
fn from_raw_hex(hex_str: &str) -> Result<Self, DeserializeError>
where Self: Sized { ... }
}Required Methods§
fn to_raw_bytes(&self) -> &[u8] ⓘ
fn from_raw_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
Provided Methods§
fn to_raw_hex(&self) -> String
fn from_raw_hex(hex_str: &str) -> Result<Self, DeserializeError>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".