Skip to main content

DigitCount

Trait DigitCount 

Source
pub(crate) trait DigitCount {
    // Required method
    fn num_digits(self) -> u8;
}
Expand description

A trait that indicates the formatted width of the value can be determined.

Note that this should not be implemented for any signed integers. This forces the caller to write the sign if desired.

Required Methods§

Source

fn num_digits(self) -> u8

The number of digits in the stringified value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DigitCount for u8

Source§

impl DigitCount for u16

Source§

impl DigitCount for u32

Implementors§