pub trait ExtractBits: Sized {
type Output;
// Required method
fn extract_bits(self, mask: Self) -> Self::Output;
}Expand description
Gathers bits through a mask (the PEXT operation).
Required Associated Types§
Sourcetype Output
type Output
Gathers the bits of self selected by the one-bits of mask into
the contiguous low-order bits of the result (the PEXT operation).
Like std, this is only provided for unsigned types.
use const_num_traits::ExtractBits;
assert_eq!(ExtractBits::extract_bits(0b0101_0011u8, 0b1111_0000), 0b101);Required Methods§
fn extract_bits(self, mask: Self) -> Self::Output
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".