[][src]Trait xalloc::int::BinaryInteger

pub trait BinaryInteger: Integer + Clone + Sized + AddAssign + SubAssign + MulAssign + DivAssign + BitOrAssign + BitAndAssign + BitXorAssign + BitOr<Self, Output = Self> + BitAnd<Self, Output = Self> + BitXor<Self, Output = Self> + Shl<u32, Output = Self> + Shr<u32, Output = Self> + Not<Output = Self> + RefSaturatingAdd<Output = Self> + Debug {
    type OneDigits: Iterator<Item = u32>;
    pub fn max_value() -> Self;
pub fn min_value() -> Self;
pub fn max_digits() -> u32;
pub fn ones(range: Range<u32>) -> Self;
pub fn ones_truncated(range: Range<u32>) -> Self;
pub fn trailing_zeros(&self) -> u32;
pub fn leading_zeros(&self) -> u32;
pub fn count_ones(&self) -> u32;
pub fn bit_scan_forward(&self, start: u32) -> u32;
pub fn extract_u32(&self, range: Range<u32>) -> u32;
pub fn get_bit(&self, i: u32) -> bool;
pub fn set_bit(&mut self, i: u32);
pub fn clear_bit(&mut self, i: u32);
pub fn checked_ceil_fix(self, fp: u32) -> Option<Self>;
pub fn one_digits(&self) -> Self::OneDigits; }

Integral types with efficient binary operations.

Associated Types

Loading content...

Required methods

pub fn max_value() -> Self[src]

pub fn min_value() -> Self[src]

pub fn max_digits() -> u32[src]

pub fn ones(range: Range<u32>) -> Self[src]

pub fn ones_truncated(range: Range<u32>) -> Self[src]

pub fn trailing_zeros(&self) -> u32[src]

Return the number of trailing zeros in its binary representation.

pub fn leading_zeros(&self) -> u32[src]

Return the number of leading zeros in its binary representation.

pub fn count_ones(&self) -> u32[src]

Return the number of ones in its binary representation.

pub fn bit_scan_forward(&self, start: u32) -> u32[src]

Return the position of the least significant set bit since the position start.

Retruns Self::max_digits() if none was found.

pub fn extract_u32(&self, range: Range<u32>) -> u32[src]

Slice a part of its binary representation as u32.

pub fn get_bit(&self, i: u32) -> bool[src]

Retrieve whether the specified bit is set or not.

pub fn set_bit(&mut self, i: u32)[src]

Set a single bit.

pub fn clear_bit(&mut self, i: u32)[src]

Clear a single bit.

pub fn checked_ceil_fix(self, fp: u32) -> Option<Self>[src]

Perform ceil treating the value as a fixed point number with fp fractional part digits.

pub fn one_digits(&self) -> Self::OneDigits[src]

Get an iterator over set bits, from the least significant bit to the most significant one.

Loading content...

Implementations on Foreign Types

impl BinaryInteger for i8[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for i16[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for i32[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for i64[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for isize[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for u8[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for u16[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for u32[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for u64[src]

type OneDigits = OneDigits<Self>

impl BinaryInteger for usize[src]

type OneDigits = OneDigits<Self>

Loading content...

Implementors

Loading content...