pub struct Hexa<'a>(pub Cow<'a, [u8]>);Expand description
Natural number represented in big-endian (possibly with leading zeroes).
This is parsed from and pretty-printed to hexadecimal (including leading zeroes). Leading zeroes are ignored during comparison (the represented natural numbers are compared).
Tuple Fields§
§0: Cow<'a, [u8]>Implementations§
Methods from Deref<Target = Cow<'a, [u8]>>§
1.0.0 · Sourcepub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned
Acquires a mutable reference to the owned form of the data.
Clones the data if it is not already owned.
§Examples
use std::borrow::Cow;
let mut cow = Cow::Borrowed("foo");
cow.to_mut().make_ascii_uppercase();
assert_eq!(
cow,
Cow::Owned(String::from("FOO")) as Cow<'_, str>
);Trait Implementations§
impl<'a> Eq for Hexa<'a>
Source§impl<'a> Ord for Hexa<'a>
impl<'a> Ord for Hexa<'a>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Auto Trait Implementations§
impl<'a> Freeze for Hexa<'a>
impl<'a> RefUnwindSafe for Hexa<'a>
impl<'a> Send for Hexa<'a>
impl<'a> Sync for Hexa<'a>
impl<'a> Unpin for Hexa<'a>
impl<'a> UnsafeUnpin for Hexa<'a>
impl<'a> UnwindSafe for Hexa<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more