[][src]Struct hex_string::HexString

pub struct HexString(_);

HexString provides a structured representation of a hex string. It is guaranteed to be a valid string, whether initialized from a string or from a byte vector.

Methods

impl HexString
[src]

pub fn from_string(s: &str) -> Result<HexString, HexStringError>
[src]

Initialize a HexString from an actual hex string. The input string must be of an even length (since it takes two hex characters to represent a byte) and must contain only characters in the range 0-9 and a-f.

This will return an InvalidStringLength error if the length is not even, and InvalidCharacter if any non-hex character is detected.

pub fn from_bytes(v: &Vec<u8>) -> HexString
[src]

Initialize a hex strign from a binary vector. This function cannot fail.

pub fn as_string(&self) -> String
[src]

Return a String representation

pub fn as_bytes(&self) -> Vec<u8>
[src]

Return a byte representation

Trait Implementations

impl PartialEq<HexString> for HexString
[src]

impl Clone for HexString
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for HexString
[src]

Auto Trait Implementations

impl Send for HexString

impl Sync for HexString

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]