BitBlock

Trait BitBlock 

Source
pub trait BitBlock:
    PrimInt
    + BitAndAssign
    + BitOrAssign
    + BitXorAssign
    + Binary
    + LowerHex
    + UpperHex
    + 'static {
    const BITS: usize;
    const EMPTY: Self;
    const LSB: Self;
    const ALL: Self;
}
Expand description

Integer that can be used as a block of bits in a bitset.

Required Associated Constants§

Source

const BITS: usize

Number of bits in the block.

Source

const EMPTY: Self

Block without any bits set, aka 0.

Source

const LSB: Self

Block with only the least significant bit set, aka 1.

Source

const ALL: Self

Block with all bits set.

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.

Implementations on Foreign Types§

Source§

impl BitBlock for u8

Source§

const BITS: usize = 8usize

Source§

const EMPTY: Self = 0u8

Source§

const LSB: Self = 1u8

Source§

const ALL: Self = 255u8

Source§

impl BitBlock for u16

Source§

const BITS: usize = 16usize

Source§

const EMPTY: Self = 0u16

Source§

const LSB: Self = 1u16

Source§

const ALL: Self = 65_535u16

Source§

impl BitBlock for u32

Source§

const BITS: usize = 32usize

Source§

const EMPTY: Self = 0u32

Source§

const LSB: Self = 1u32

Source§

const ALL: Self = 4_294_967_295u32

Source§

impl BitBlock for u64

Source§

const BITS: usize = 64usize

Source§

const EMPTY: Self = 0u64

Source§

const LSB: Self = 1u64

Source§

const ALL: Self = 18_446_744_073_709_551_615u64

Source§

impl BitBlock for u128

Source§

const BITS: usize = 128usize

Source§

const EMPTY: Self = 0u128

Source§

const LSB: Self = 1u128

Source§

const ALL: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Implementors§