Bits

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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,