Trait BitInformation

Source
pub trait BitInformation {
    // Required methods
    fn number_of_bits(&self) -> usize;
    fn has_x_bit(&self, position: usize) -> bool;

    // Provided methods
    fn is_bit_in_bounds(&self, position: usize) -> bool { ... }
    fn has_most_signifigant_bit(&self) -> bool { ... }
}

Required Methods§

Source

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source

fn has_x_bit(&self, position: usize) -> bool

Checks to see if bit X is set

Provided Methods§

Source

fn is_bit_in_bounds(&self, position: usize) -> bool

Checks to see if the requested bit position is in bounds

Source

fn has_most_signifigant_bit(&self) -> bool

Checks to see if the most signifigant bit is set

Implementations on Foreign Types§

Source§

impl BitInformation for i8

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for i16

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for i32

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for i64

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for isize

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for u8

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for u16

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for u32

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for u64

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Source§

impl BitInformation for usize

Source§

fn number_of_bits(&self) -> usize

Gets the number of bits contained in this type

Source§

fn has_x_bit(&self, position: usize) -> bool

Implementors§