Trait exonum::encoding::serialize::FromHex
[−]
[src]
pub trait FromHex { type Error; fn from_hex<T>(hex: T) -> Result<Self, Self::Error>
where
T: AsRef<[u8]>; }
Types that can be decoded from a hex string.
This trait is implemented for Vec<u8>
and small u8
-arrays.
Example
use hex::FromHex; match Vec::from_hex("48656c6c6f20776f726c6421") { Ok(vec) => { for b in vec { println!("{}", b as char); } } Err(e) => { // Deal with the error ... } }
Associated Types
type Error
Required Methods
fn from_hex<T>(hex: T) -> Result<Self, Self::Error> where
T: AsRef<[u8]>,
T: AsRef<[u8]>,
Creates an instance of type Self
from the given hex string, or fails
with a custom error type.
Both, upper and lower case characters are valid and can even be
mixed (e.g. f9b4ca
, F9B4CA
and f9B4Ca
are all valid strings).
Implementations on Foreign Types
impl FromHex for [u8; 48]
[src]
impl FromHex for [u8; 2]
[src]
impl FromHex for [u8; 10]
[src]
impl FromHex for [u8; 5]
[src]
impl FromHex for Vec<u8>
[src]
impl FromHex for [u8; 3]
[src]
impl FromHex for [u8; 64]
[src]
impl FromHex for [u8; 6]
[src]
impl FromHex for [u8; 56]
[src]
impl FromHex for [u8; 8]
[src]
impl FromHex for [u8; 40]
[src]
impl FromHex for [u8; 9]
[src]
impl FromHex for [u8; 12]
[src]
impl FromHex for [u8; 16]
[src]
impl FromHex for [u8; 1]
[src]
impl FromHex for [u8; 32]
[src]
impl FromHex for [u8; 7]
[src]
impl FromHex for [u8; 4]
[src]
impl FromHex for [u8; 13]
[src]
impl FromHex for [u8; 11]
[src]
impl FromHex for [u8; 15]
[src]
impl FromHex for [u8; 24]
[src]
impl FromHex for [u8; 14]
[src]
Implementors
impl FromHex for Connect type Error = Error;
impl FromHex for Status type Error = Error;
impl FromHex for Propose type Error = Error;
impl FromHex for Prevote type Error = Error;
impl FromHex for Precommit type Error = Error;
impl FromHex for BlockResponse type Error = Error;
impl FromHex for ProposeRequest type Error = Error;
impl FromHex for TransactionsRequest type Error = Error;
impl FromHex for PrevotesRequest type Error = Error;
impl FromHex for PeersRequest type Error = Error;
impl FromHex for BlockRequest type Error = Error;
impl FromHex for Hash type Error = FromHexError;
impl FromHex for PublicKey type Error = FromHexError;
impl FromHex for SecretKey type Error = FromHexError;
impl FromHex for Seed type Error = FromHexError;
impl FromHex for Signature type Error = FromHexError;