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§
Sourcefn get_digit_at(&self, digit: usize) -> Option<u8>
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));