Trait bounded_integer::Repr [] [src]

pub trait Repr: Copy + Eq + Ord {
    fn is_negative(self) -> bool;
    fn checked_add(self, other: Self) -> Option<Self>;
    fn checked_sub(self, other: Self) -> Option<Self>;
    fn checked_mul(self, other: Self) -> Option<Self>;
    fn checked_div(self, other: Self) -> Option<Self>;
    fn checked_rem(self, other: Self) -> Option<Self>;
    fn checked_neg(self) -> Option<Self>;
}

Integer representation.

Reflects the types valid in #[repr(...)] for C-like enums, so should not be implemented for additional types.

Required Methods

Returns true if negative.

Checked integer addition.

Checked integer subtraction.

Checked integer multiplication.

Checked integer division.

Checked integer remainder.

Checked integer negation.

Implementors