Trait DigitAt

Source
pub trait DigitAt {
    // Required method
    fn get_digit_at(&self, digit: usize) -> Option<u8>;
}
Expand description

Specifies that a type can deliver a radix at a certain digit/depth.

Required Methods§

Source

fn get_digit_at(&self, digit: usize) -> Option<u8>

Extracts a radix value at a certain digit for a type. Should return None if no value exists at the digit.

#Example

use afsort::DigitAt;

let num = 0x0502u16;
assert_eq!(Some(5), num.get_digit_at(0));
assert_eq!(Some(2), num.get_digit_at(1));
assert_eq!(None, num.get_digit_at(2));

Implementations on Foreign Types§

Source§

impl DigitAt for u8

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl DigitAt for u16

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl DigitAt for u32

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl DigitAt for u64

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for &'a str

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for &'a [u8]

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for Cow<'a, str>

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for String

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for [u8]

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Source§

impl<'a> DigitAt for dyn AsRef<dyn DigitAt>

Source§

fn get_digit_at(&self, digit: usize) -> Option<u8>

Implementors§