A trait used to retrieve the size of a type in bits.

Signature

pub trait BitSize

Trait functions

bits

Returns the bit size of T as a usize.

Signature

fn bits() -> u32

Examples

use core::num::traits::BitSize;

let bits = BitSize::::bits();
assert!(bits == 8);