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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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