Trait aoc::util::integer::Integer

source ·
pub trait Integer<T>:
    Copy
    + From<u8>
    + PartialEq
    + PartialOrd
    + Add<Output = T>
    + BitAnd<Output = T>
    + BitOr<Output = T>
    + BitXor<Output = T>
    + Div<Output = T>
    + Mul<Output = T>
    + Rem<Output = T>
    + Shl<Output = T>
    + Shr<Output = T>
    + Sub<Output = T> {
    const ZERO: T;
    const ONE: T;
    const TEN: T;

    // Required methods
    fn ilog2(self) -> T;
    fn trailing_zeros(self) -> T;
}

Required Associated Constants§

source

const ZERO: T

source

const ONE: T

source

const TEN: T

Required Methods§

source

fn ilog2(self) -> T

source

fn trailing_zeros(self) -> T

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Integer<i16> for i16

source§

const ZERO: i16 = 0i16

source§

const ONE: i16 = 1i16

source§

const TEN: i16 = 10i16

source§

fn ilog2(self) -> i16

source§

fn trailing_zeros(self) -> i16

source§

impl Integer<i32> for i32

source§

const ZERO: i32 = 0i32

source§

const ONE: i32 = 1i32

source§

const TEN: i32 = 10i32

source§

fn ilog2(self) -> i32

source§

fn trailing_zeros(self) -> i32

source§

impl Integer<i64> for i64

source§

const ZERO: i64 = 0i64

source§

const ONE: i64 = 1i64

source§

const TEN: i64 = 10i64

source§

fn ilog2(self) -> i64

source§

fn trailing_zeros(self) -> i64

source§

impl Integer<i128> for i128

source§

const ZERO: i128 = 0i128

source§

const ONE: i128 = 1i128

source§

const TEN: i128 = 10i128

source§

fn ilog2(self) -> i128

source§

fn trailing_zeros(self) -> i128

source§

impl Integer<u8> for u8

source§

const ZERO: u8 = 0u8

source§

const ONE: u8 = 1u8

source§

const TEN: u8 = 10u8

source§

fn ilog2(self) -> u8

source§

fn trailing_zeros(self) -> u8

source§

impl Integer<u16> for u16

source§

const ZERO: u16 = 0u16

source§

const ONE: u16 = 1u16

source§

const TEN: u16 = 10u16

source§

fn ilog2(self) -> u16

source§

fn trailing_zeros(self) -> u16

source§

impl Integer<u32> for u32

source§

const ZERO: u32 = 0u32

source§

const ONE: u32 = 1u32

source§

const TEN: u32 = 10u32

source§

fn ilog2(self) -> u32

source§

fn trailing_zeros(self) -> u32

source§

impl Integer<u64> for u64

source§

const ZERO: u64 = 0u64

source§

const ONE: u64 = 1u64

source§

const TEN: u64 = 10u64

source§

fn ilog2(self) -> u64

source§

fn trailing_zeros(self) -> u64

source§

impl Integer<u128> for u128

source§

const ZERO: u128 = 0u128

source§

const ONE: u128 = 1u128

source§

const TEN: u128 = 10u128

source§

fn ilog2(self) -> u128

source§

fn trailing_zeros(self) -> u128

source§

impl Integer<usize> for usize

source§

const ZERO: usize = 0usize

source§

const ONE: usize = 1usize

source§

const TEN: usize = 10usize

source§

fn ilog2(self) -> usize

source§

fn trailing_zeros(self) -> usize

Implementors§