Trait bitintr::Int
[−]
[src]
pub trait Int: Sized + Copy + Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> + Not<Output=Self> + BitAnd<Output=Self> + BitOr<Output=Self> + BitXor<Output=Self> + Shr<Self, Output=Self> + Shl<Self, Output=Self> + PartialEq + PartialOrd { type Unsigned: Int; type Signed: Int; fn one() -> Self; fn zero() -> Self; fn byte_size() -> Self; fn bit_size() -> Self; fn count_ones(self) -> Self; fn count_zeros(self) -> Self; fn leading_zeros(self) -> Self; fn trailing_zeros(self) -> Self; fn wrapping_neg(self) -> Self; fn wrapping_add(self, _: Self) -> Self; fn wrapping_sub(self, _: Self) -> Self; fn wrapping_shl(self, _: Self) -> Self; fn wrapping_shr(self, _: Self) -> Self; fn to_u32(self) -> u32; fn to_u64(self) -> u64; fn from_u16(_: u16) -> Self; fn from_u32(_: u32) -> Self; fn from_u64(_: u64) -> Self; fn rotate_left(self, _: u32) -> Self; fn rotate_right(self, _: u32) -> Self; fn swap_bytes(self) -> Self; fn from_be(self) -> Self; fn from_le(self) -> Self; fn to_be(self) -> Self; fn to_le(self) -> Self; fn pow(self, exp: u32) -> Self; fn to_unsigned(self) -> Self::Unsigned; fn to_signed(self) -> Self::Signed; fn from_unsigned(_: Self::Unsigned) -> Self; fn from_signed(_: Self::Signed) -> Self; }
Integer trait used to parametrize algorithms for all integer types.
Associated Types
Required Methods
fn one() -> Self
fn zero() -> Self
fn byte_size() -> Self
fn bit_size() -> Self
fn count_ones(self) -> Self
fn count_zeros(self) -> Self
fn leading_zeros(self) -> Self
fn trailing_zeros(self) -> Self
fn wrapping_neg(self) -> Self
fn wrapping_add(self, _: Self) -> Self
fn wrapping_sub(self, _: Self) -> Self
fn wrapping_shl(self, _: Self) -> Self
fn wrapping_shr(self, _: Self) -> Self
fn to_u32(self) -> u32
fn to_u64(self) -> u64
fn from_u16(_: u16) -> Self
fn from_u32(_: u32) -> Self
fn from_u64(_: u64) -> Self
fn rotate_left(self, _: u32) -> Self
fn rotate_right(self, _: u32) -> Self
fn swap_bytes(self) -> Self
fn from_be(self) -> Self
fn from_le(self) -> Self
fn to_be(self) -> Self
fn to_le(self) -> Self
fn pow(self, exp: u32) -> Self
fn to_unsigned(self) -> Self::Unsigned
fn to_signed(self) -> Self::Signed
fn from_unsigned(_: Self::Unsigned) -> Self
fn from_signed(_: Self::Signed) -> Self
Implementors
impl Int for u8
impl Int for u16
impl Int for u32
impl Int for u64
impl Int for usize
impl Int for i8
impl Int for i16
impl Int for i32
impl Int for i64
impl Int for isize