BitfieldSize

Trait BitfieldSize 

Source
pub trait BitfieldSize {
    // Required method
    fn bit_size() -> usize;

    // Provided method
    fn byte_size() -> usize { ... }
}
Expand description

Trait for getting the size of a bitfield structure.

Required Methods§

Source

fn bit_size() -> usize

Return the total number of bits in the bitfield.

Provided Methods§

Source

fn byte_size() -> usize

Return the number of bytes needed to store the bitfield (rounded up).

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 BitfieldSize for u8

Source§

impl BitfieldSize for u16

Source§

impl BitfieldSize for u32

Source§

impl BitfieldSize for u64

Implementors§