pub trait Word:
Sealed
+ Copy
+ Default
+ Eq
+ Ord
+ Hash
+ Debug
+ Send
+ Sync
+ 'static
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ BitXor<Output = Self>
+ Not<Output = Self>
+ Shl<usize, Output = Self>
+ Shr<usize, Output = Self> {
const BITS: usize;
const ZERO: Self;
const ONES: Self;
// Required methods
fn count_ones(self) -> u32;
fn to_u64(self) -> u64;
fn from_u64(value: u64) -> Self;
}Expand description
The machine integer a bit kernel shifts and masks.
Every operation inside a word goes through this, so a kernel is written once per shape.
Required Associated Constants§
Required Methods§
Sourcefn count_ones(self) -> u32
fn count_ones(self) -> u32
How many bits are set.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".