pub trait FromHex: Sized {
// Required method
fn from_hex(s: &str) -> Result<Self, DecodeError>;
}Expand description
A trait to deserialize something from a hex-encoded string slice.
Examples:
use lexe_hex::hex::FromHex;
let s = String::from("e7f51d925349a26f742e6eef3670f489aaf14fbbb5b5c3f209892f2f1baae1c9");
<Vec<u8>>::from_hex(&s).unwrap();
<Cow<'_, [u8]>>::from_hex(&s).unwrap();
<[u8; 32]>::from_hex(&s).unwrap();Required Methods§
fn from_hex(s: &str) -> Result<Self, DecodeError>
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.