atoi

Trait MaxNumDigits

Source
pub trait MaxNumDigits {
    // Required methods
    fn max_num_digits(radix: Self) -> usize;
    fn max_num_digits_negative(radix: Self) -> usize;
}
Expand description

A bounded integer, whose representation can overflow and therefore can only store a maximum number of digits

Required Methods§

Source

fn max_num_digits(radix: Self) -> usize

Given a representation with a radix character I, what is the maximum number of digits we can parse without the integer overflowing for sure?

Source

fn max_num_digits_negative(radix: Self) -> usize

Returns the maximum number of digits a negative representation of I can have depending on radix.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I> MaxNumDigits for I
where I: Bounded + Zero + DivAssign + Ord + Copy,