pub trait ToBits {
    fn to_bits<const N: usize>(self) -> Bits<N>;
}
Expand description

The ToBits trait is used to provide a way to convert Rust standard unsigned types (currently u8, u16, u32, u64, u128) into Bits of different lengths. Note that RustHDL will panic if you attempt to convert an unsigned type into a Bits that is too small to hold the value.

Required Methods

Convert the underlying type to a Bits of the specified size. Invoked using

let x : Bits<4> = 0xF_u8.to_bits();

Implementations on Foreign Types

Implementors