pub trait HexPrefix {
// Required method
fn hex_prefix(self) -> String;
}
Expand description
A type that can be represented in hexadecimal (with a 0x
prefix).
Required Methods§
Sourcefn hex_prefix(self) -> String
fn hex_prefix(self) -> String
Turn self
into a hexadecimal string prefixed with 0x
.
Implementations on Foreign Types§
Source§impl HexPrefix for (u64, u64)
impl HexPrefix for (u64, u64)
Source§fn hex_prefix(self) -> String
fn hex_prefix(self) -> String
Combine the low and high bits of a u128
as a lower-case hexadecimal string prefixed with 0x
.
assert_eq!((0, 0).hex_prefix(), "0x0");
assert_eq!((0, u64::MAX).hex_prefix(), "0xffffffffffffffff0000000000000000");
assert_eq!((u64::MAX, 0).hex_prefix(), "0xffffffffffffffff");
assert_eq!((u64::MAX, u64::MAX).hex_prefix(), "0xffffffffffffffffffffffffffffffff");