Skip to main content

FromHex

Trait FromHex 

Source
pub trait FromHex: Sized {
    type Error: Display;

    // Required method
    fn from_hex(hex_str: &str) -> Result<Self, Self::Error>;
}
Expand description

Trait for types that can be parsed from a hexadecimal string.

Required Associated Types§

Source

type Error: Display

Error type returned when hex decoding fails.

Required Methods§

Source

fn from_hex(hex_str: &str) -> Result<Self, Self::Error>

Parses hex_str into Self, returning an error on invalid hex input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromHex for Vec<u8>

Little endian format of full content (so string lengths must be even).

Source§

type Error = Error

Source§

fn from_hex(hex_str: &str) -> Result<Self, Self::Error>

Implementors§