Skip to main content

IntoDigits

Trait IntoDigits 

Source
pub trait IntoDigits: Sized {
    type Digit;

    // Provided methods
    fn into_digits(self) -> impl Iterator<Item = Self::Digit> { ... }
    fn into_rev_digits(self) -> impl Iterator<Item = Self::Digit> { ... }
}
Expand description

Decompose a non-negative integer into its base-10 digits.

See: https://en.wikipedia.org/wiki/Positional_notation

Required Associated Types§

Provided Methods§

Source

fn into_digits(self) -> impl Iterator<Item = Self::Digit>

Iterator over digits, most-significant first.

Source

fn into_rev_digits(self) -> impl Iterator<Item = Self::Digit>

Iterator over digits, least-significant first.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntoDigits for usize

Source§

type Digit = u8

Source§

fn into_rev_digits(self) -> impl Iterator<Item = u8>

Implementors§