Trait core::fmt::num::GenericRadix

source ·
unsafe trait GenericRadix: Sized {
    const BASE: u8;
    const PREFIX: &'static str;

    // Required method
    fn digit(x: u8) -> u8;

    // Provided method
    fn fmt_int<T: DisplayInt>(&self, x: T, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description

A type that represents a specific radix

Safety

digit must return an ASCII character.

Required Associated Constants§

source

const BASE: u8

The number of digits.

source

const PREFIX: &'static str

A radix-specific prefix string.

Required Methods§

source

fn digit(x: u8) -> u8

Converts an integer to corresponding radix digit.

Provided Methods§

source

fn fmt_int<T: DisplayInt>(&self, x: T, f: &mut Formatter<'_>) -> Result

Format an integer using the radix using a formatter.

Implementors§