Trait IntBase

Source
pub trait IntBase:
    Copy
    + Bounded
    + Zero
    + One
    + Eq
    + Ord
    + Default
    + FromStr
    + Display
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Rem<Output = Self>
    + AddAssign
    + SubAssign
    + MulAssign
    + DivAssign
    + RemAssign
    + Sum
    + Product {
    type Error;

    // Required methods
    fn div_euclid(self, rhs: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
    fn pow(self, exp: u32) -> Self;
    fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>;
    fn ilog(self, base: Self) -> u32;
    fn ilog2(self) -> u32;
    fn ilog10(self) -> u32;
}
Expand description

Trait for basic primitive integer operations.

Required Associated Types§

Required Methods§

Source

fn div_euclid(self, rhs: Self) -> Self

Source

fn rem_euclid(self, rhs: Self) -> Self

Source

fn pow(self, exp: u32) -> Self

Source

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source

fn ilog(self, base: Self) -> u32

Source

fn ilog2(self) -> u32

Source

fn ilog10(self) -> u32

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntBase for i8

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for i16

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for i32

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for i64

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for i128

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for isize

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for u8

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for u16

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for u32

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for u64

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for u128

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Source§

impl IntBase for usize

Source§

type Error = ParseIntError

Source§

fn div_euclid(self, rhs: Self) -> Self

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn pow(self, exp: u32) -> Self

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::Error>

Source§

fn ilog(self, base: Self) -> u32

Source§

fn ilog2(self) -> u32

Source§

fn ilog10(self) -> u32

Implementors§

Source§

impl IntBase for Saturating<i8>

Source§

impl IntBase for Saturating<i16>

Source§

impl IntBase for Saturating<i32>

Source§

impl IntBase for Saturating<i64>

Source§

impl IntBase for Saturating<i128>

Source§

impl IntBase for Saturating<isize>

Source§

impl IntBase for Saturating<u8>

Source§

impl IntBase for Saturating<u16>

Source§

impl IntBase for Saturating<u32>

Source§

impl IntBase for Saturating<u64>

Source§

impl IntBase for Saturating<u128>

Source§

impl IntBase for Saturating<usize>

Source§

impl IntBase for Wrapping<i8>

Source§

impl IntBase for Wrapping<i16>

Source§

impl IntBase for Wrapping<i32>

Source§

impl IntBase for Wrapping<i64>

Source§

impl IntBase for Wrapping<i128>

Source§

impl IntBase for Wrapping<isize>

Source§

impl IntBase for Wrapping<u8>

Source§

impl IntBase for Wrapping<u16>

Source§

impl IntBase for Wrapping<u32>

Source§

impl IntBase for Wrapping<u64>

Source§

impl IntBase for Wrapping<u128>

Source§

impl IntBase for Wrapping<usize>