Struct hex_wrapper::HexUsize [−][src]
pub struct HexUsize(_);Expand description
Pointer-sized unsigned hexadecimal numbers.
use hex_wrapper::HexUsize;
// from random value
let rand = HexUsize::rand();
let inner = rand.get();
assert_eq!(rand.to_string(), format!("{:x}", inner));
// from given value
let given = HexUsize::from(0xa3);
assert_eq!(given.to_string(), String::from("a3"));
// from string
let from_str = "a3".parse::<HexUsize>();
assert_eq!(from_str.unwrap(), HexUsize::from(0xa3));Implementations
Creates a random hex. This is equivalent to
Self::with_rng(rand::thread_rng()).
Gets the mutable reference to the interior value.
Trait Implementations
Creates a null hex (i.e., 0).
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for HexUsize
impl UnwindSafe for HexUsize
Blanket Implementations
Mutably borrows from an owned value. Read more
