pub trait BitIndexable {
    // Required methods
    fn bit_at(&self, index: &BitIndex) -> u8;
    fn bit_slice(&self, start: &BitIndex, end: &BitIndex) -> BitField;
    fn max_index(&self) -> BitIndex;
}

Required Methods§

source

fn bit_at(&self, index: &BitIndex) -> u8

Get the bit at the given bit index. Returns a u8 instead of a bool to accommodate operations such as bitshifts on the result, but this function should always return either 0 or 1.

source

fn bit_slice(&self, start: &BitIndex, end: &BitIndex) -> BitField

source

fn max_index(&self) -> BitIndex

Get the bit index that is equivalent to the length of the structure (accessing at this index is out of bounds, but any index below this is allowed)

Implementations on Foreign Types§

source§

impl<T: BitIndexable> BitIndexable for &T

source§

fn bit_at(&self, index: &BitIndex) -> u8

source§

fn bit_slice(&self, start: &BitIndex, end: &BitIndex) -> BitField

source§

fn max_index(&self) -> BitIndex

source§

impl BitIndexable for Vec<u8>

source§

fn bit_at(&self, index: &BitIndex) -> u8

source§

fn bit_slice(&self, start: &BitIndex, end: &BitIndex) -> BitField

source§

fn max_index(&self) -> BitIndex

Implementors§