Trait kdmp_parser::Bits

source ·
pub trait Bits: Sized {
    // Required method
    fn bits(&self, r: RangeInclusive<usize>) -> Self;

    // Provided method
    fn bit(&self, n: usize) -> Self { ... }
}
Expand description

Utility trait to make it easier to extract ranges of bits.

Required Methods§

source

fn bits(&self, r: RangeInclusive<usize>) -> Self

Get a range of bits.

Provided Methods§

source

fn bit(&self, n: usize) -> Self

Get a bit.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Bits for T
where T: Into<u128> + Copy + TryFrom<u128>, <T as TryFrom<u128>>::Error: Debug,