machine_check/
traits.rs

1/**
2 * Bitvector extension / narrowing trait.
3 *
4 * The amount of bits in the result is given by the generic parameter `X`.
5 * If `X` is greater than original number of bits, the bitvector is extended according to its type.
6 * If `X` is lesser than original number of bits, the highest bits of bitvector are dropped.
7 */
8pub trait Ext<const X: u32> {
9    type Output;
10
11    #[must_use]
12    fn ext(self) -> Self::Output;
13}