pub struct HexString(/* private fields */);Expand description
String of valid hexadecimal characters, with optional 0x/0X prefix.
Implementations§
Source§impl HexString
impl HexString
Sourcepub fn new(value: impl Into<String>) -> PrimitiveResult<Self>
pub fn new(value: impl Into<String>) -> PrimitiveResult<Self>
Creates a new HexString. Returns Invalid if any character is not a
valid hex digit (after stripping an optional 0x/0X prefix).
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the wrapper and returns the inner string.
Sourcepub fn has_prefix(&self) -> bool
pub fn has_prefix(&self) -> bool
Returns true if the value was stored with a 0x/0X prefix.
Sourcepub fn hex_digits(&self) -> &str
pub fn hex_digits(&self) -> &str
Returns only the hex digit characters, without any 0x/0X prefix.
Trait Implementations§
Source§impl Ord for HexString
impl Ord for HexString
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
Source§impl PartialOrd for HexString
impl PartialOrd for HexString
impl Eq for HexString
impl StructuralPartialEq for HexString
Auto Trait Implementations§
impl Freeze for HexString
impl RefUnwindSafe for HexString
impl Send for HexString
impl Sync for HexString
impl Unpin for HexString
impl UnsafeUnpin for HexString
impl UnwindSafe for HexString
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