SignedInteger

Trait SignedInteger 

Source
pub trait SignedInteger:
    Numeric
    + Neg<Output = Self>
    + Add<Self, Output = Self>
    + AddAssign<Self>
    + Div<Self, Output = Self>
    + DivAssign<Self>
    + Mul<Self, Output = Self>
    + MulAssign<Self>
    + Rem<Self, Output = Self>
    + RemAssign<Self>
    + Sub<Self, Output = Self>
    + SubAssign<Self>
    + BitAnd<Self, Output = Self>
    + BitAndAssign<Self>
    + BitOr<Self, Output = Self>
    + BitOrAssign<Self>
    + BitXor<Self, Output = Self>
    + BitXorAssign<Self>
    + Not<Output = Self>
    + Shl<usize, Output = Self>
    + ShlAssign<usize>
    + Shr<usize, Output = Self>
    + ShrAssign<usize>
    + CastFrom<f64>
    + CastInto<f64> {
    type Unsigned: UnsignedInteger<Signed = Self> + CastFrom<Self>;

    // Required methods
    fn into_unsigned(self) -> Self::Unsigned;
    fn to_bits_string(&self, block_length: usize) -> String;
}
Expand description

A trait shared by all the unsigned integer types.

Required Associated Types§

Source

type Unsigned: UnsignedInteger<Signed = Self> + CastFrom<Self>

The unsigned type of the same precicion

Required Methods§

Source

fn into_unsigned(self) -> Self::Unsigned

Returns the casting of the current value to the unsigned type of the same size.

Source

fn to_bits_string(&self, block_length: usize) -> String

Returns a bit representation of the integer, where blocks of length block_length are separated by whitespaces to increase the readability.

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 SignedInteger for i8

Source§

type Unsigned = u8

Source§

fn into_unsigned(self) -> Self::Unsigned

Source§

fn to_bits_string(&self, break_every: usize) -> String

Source§

impl SignedInteger for i16

Source§

type Unsigned = u16

Source§

fn into_unsigned(self) -> Self::Unsigned

Source§

fn to_bits_string(&self, break_every: usize) -> String

Source§

impl SignedInteger for i32

Source§

type Unsigned = u32

Source§

fn into_unsigned(self) -> Self::Unsigned

Source§

fn to_bits_string(&self, break_every: usize) -> String

Source§

impl SignedInteger for i64

Source§

type Unsigned = u64

Source§

fn into_unsigned(self) -> Self::Unsigned

Source§

fn to_bits_string(&self, break_every: usize) -> String

Source§

impl SignedInteger for i128

Source§

type Unsigned = u128

Source§

fn into_unsigned(self) -> Self::Unsigned

Source§

fn to_bits_string(&self, break_every: usize) -> String

Implementors§