pub trait TryFromBytes: Sized {
// Required method
fn try_from_bytes(bytes: &[u8]) -> StdResult<Self>;
// Provided method
fn try_from_bytes_hex(hex_string: &str) -> StdResult<Self> { ... }
}
Expand description
Traits for deserializing from bytes
Required Methods§
Sourcefn try_from_bytes(bytes: &[u8]) -> StdResult<Self>
fn try_from_bytes(bytes: &[u8]) -> StdResult<Self>
Try to convert from a bytes slice.
Provided Methods§
Sourcefn try_from_bytes_hex(hex_string: &str) -> StdResult<Self>
fn try_from_bytes_hex(hex_string: &str) -> StdResult<Self>
Try to convert from hex string encoded bytes.
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.