Trait fraction::generic::GenericInteger

source ·
pub trait GenericInteger:
    'static
    + Sized
    + Integer
    + ToPrimitive
    + CheckedAdd
    + CheckedDiv
    + CheckedMul
    + CheckedSub
    + Add
    + Div
    + Mul
    + Rem
    + Sub
    + AddAssign
    + DivAssign
    + MulAssign
    + RemAssign
    + SubAssign
    + for<'a> Add<&'a Self, Output = Self>
    + for<'a> Div<&'a Self, Output = Self>
    + for<'a> Mul<&'a Self, Output = Self>
    + for<'a> Rem<&'a Self, Output = Self>
    + for<'a> Sub<&'a Self, Output = Self>
    + for<'a> AddAssign<&'a Self>
    + for<'a> DivAssign<&'a Self>
    + for<'a> MulAssign<&'a Self>
    + for<'a> RemAssign<&'a Self>
    + for<'a> SubAssign<&'a Self> {
    // Required methods
    fn _0() -> Self;
    fn _1() -> Self;
    fn _10() -> Self;
    fn _0r() -> Option<&'static Self>;
    fn _1r() -> Option<&'static Self>;
    fn _10r() -> Option<&'static Self>;
    fn get_signed_value(self) -> (Sign, Self);
}
Expand description

Methods common to all integer types that could be used generically in abstract algorithms

Required Methods§

source

fn _0() -> Self

Returns value 0 of the type

source

fn _1() -> Self

Returns value 1 of the type

source

fn _10() -> Self

Returns value 10 of the type

source

fn _0r() -> Option<&'static Self>

Returns Maybe of 0

source

fn _1r() -> Option<&'static Self>

Returns Maybe of 1

source

fn _10r() -> Option<&'static Self>

Returns Maybe of 10

source

fn get_signed_value(self) -> (Sign, Self)

Returns the sign and the value itself. Zero values must have Sign::Plus

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl GenericInteger for i8

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for i16

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for i32

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for i64

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for i128

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for isize

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for u8

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for u16

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for u32

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for u64

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for u128

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

source§

impl GenericInteger for usize

source§

fn _0() -> Self

source§

fn _1() -> Self

source§

fn _10() -> Self

source§

fn _0r() -> Option<&'static Self>

source§

fn _1r() -> Option<&'static Self>

source§

fn _10r() -> Option<&'static Self>

source§

fn get_signed_value(self) -> (Sign, Self)

Implementors§