Trait HexPrefix

Source
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§

Source

fn hex_prefix(self) -> String

Turn self into a hexadecimal string prefixed with 0x.

Implementations on Foreign Types§

Source§

impl HexPrefix for (u64, u64)

Source§

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");
Source§

impl HexPrefix for i8

Source§

impl HexPrefix for i16

Source§

impl HexPrefix for i32

Source§

impl HexPrefix for i64

Source§

impl HexPrefix for i128

Source§

impl HexPrefix for isize

Source§

impl HexPrefix for u8

Source§

impl HexPrefix for u16

Source§

impl HexPrefix for u32

Source§

impl HexPrefix for u64

Source§

impl HexPrefix for u128

Source§

impl HexPrefix for usize

Implementors§