FromHex

Trait FromHex 

Source
pub trait FromHex: Sized {
    type Err: From<HexToBytesError> + Sized + Debug + Display;

    // Required method
    fn from_byte_iter<I>(iter: I) -> Result<Self, Self::Err>
       where I: Iterator<Item = Result<u8, HexToBytesError>> + ExactSizeIterator + DoubleEndedIterator;

    // Provided method
    fn from_hex(s: &str) -> Result<Self, Self::Err> { ... }
}
Expand description

Trait for objects that can be deserialized from hex strings.

Required Associated Types§

Source

type Err: From<HexToBytesError> + Sized + Debug + Display

Error type returned while parsing hex string.

Required Methods§

Source

fn from_byte_iter<I>(iter: I) -> Result<Self, Self::Err>

Produces an object from a byte iterator.

Provided Methods§

Source

fn from_hex(s: &str) -> Result<Self, Self::Err>

Produces an object from a hex string.

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.

Implementations on Foreign Types§

Source§

impl FromHex for [u8; 2]

Source§

impl FromHex for [u8; 4]

Source§

impl FromHex for [u8; 6]

Source§

impl FromHex for [u8; 8]

Source§

impl FromHex for [u8; 10]

Source§

impl FromHex for [u8; 12]

Source§

impl FromHex for [u8; 14]

Source§

impl FromHex for [u8; 16]

Source§

impl FromHex for [u8; 20]

Source§

impl FromHex for [u8; 24]

Source§

impl FromHex for [u8; 28]

Source§

impl FromHex for [u8; 32]

Source§

impl FromHex for [u8; 33]

Source§

impl FromHex for [u8; 64]

Source§

impl FromHex for [u8; 65]

Source§

impl FromHex for [u8; 128]

Source§

impl FromHex for [u8; 256]

Source§

impl FromHex for [u8; 384]

Source§

impl FromHex for [u8; 512]

Implementors§