BitExtraction

Trait BitExtraction 

Source
pub trait BitExtraction {
    // Required methods
    fn extract_bit(self, position: u32) -> u64;
    fn extract_bits(self, range: Range<u32>) -> u64;
    fn low_bits(self, num_bits: u32) -> u64;
    fn low_bits_signed(self, num_bits: u32) -> u64;
    fn sign_extend(self, sign_bit: u32) -> u64;
}

Required Methods§

Source

fn extract_bit(self, position: u32) -> u64

Extract a single bit from the provided value.

Source

fn extract_bits(self, range: Range<u32>) -> u64

Extract range bits from the provided value.

Source

fn low_bits(self, num_bits: u32) -> u64

Extract the low num_bits bits from self.

Source

fn low_bits_signed(self, num_bits: u32) -> u64

Extract the low num_bits bits from self, sign extending from the most significant bit.

Source

fn sign_extend(self, sign_bit: u32) -> u64

Sign-extend self from the given sign bit.

Implementations on Foreign Types§

Source§

impl BitExtraction for u64

Source§

fn extract_bit(self, position: u32) -> u64

Source§

fn extract_bits(self, range: Range<u32>) -> u64

Source§

fn low_bits(self, num_bits: u32) -> u64

Source§

fn low_bits_signed(self, num_bits: u32) -> u64

Source§

fn sign_extend(self, sign_bit: u32) -> u64

Implementors§