Struct hex_wrapper::NonZeroHex8 [−][src]
pub struct NonZeroHex8(_);Expand description
8-bit unsigned nonzero hexadecimal numbers.
use hex_wrapper::NonZeroHex8;
// from random value
let rand = NonZeroHex8::rand();
let inner = rand.get();
assert_eq!(rand.to_string(), format!("{:x}", inner));
// from given value
let given = NonZeroHex8::new(0xa3).unwrap();
assert_eq!(given.to_string(), String::from("a3"));
// from string
let from_str = "a3".parse::<NonZeroHex8>();
assert_eq!(from_str.unwrap(), NonZeroHex8::new(0xa3).unwrap());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
type Expression = <&'a NonZeroU8 as AsExpression<T>>::Expression
type Expression = <&'a NonZeroU8 as AsExpression<T>>::Expression
The expression being returned
Perform the conversion
type Expression = <NonZeroU8 as AsExpression<T>>::Expression
type Expression = <NonZeroU8 as AsExpression<T>>::Expression
The expression being returned
Perform the conversion
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
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 NonZeroHex8
impl Send for NonZeroHex8
impl Sync for NonZeroHex8
impl Unpin for NonZeroHex8
impl UnwindSafe for NonZeroHex8
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert self to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self to an expression for Diesel’s query builder. Read more
