pub unsafe trait Underlier:
Copy
+ Default
+ Eq
+ Hash
+ Debug
+ Send
+ Sync
+ 'static {
type Word: Word;
const WORDS: usize;
const ZERO: Self;
const ONES: Self;
const BITS: usize = _;
// Required methods
fn words(&self) -> &[Self::Word];
fn words_mut(&mut self) -> &mut [Self::Word];
fn from_words_fn(f: impl FnMut(usize) -> Self::Word) -> Self;
fn random<R: Rng + ?Sized>(rng: &mut R) -> Self;
// Provided method
fn zip(
self,
other: Self,
op: impl Fn(Self::Word, Self::Word) -> Self::Word,
) -> Self { ... }
}Expand description
A fixed-width block of bits, addressed as an array of words.
Word 0 holds the lowest bits of the block, and bit 0 of a word is the lowest of all.
§Safety
A value must be exactly its words and nothing else:
- its size must equal the word count times the size of one word,
- its alignment must be at least a word’s.
Reinterpreting a run of values as a run of words relies on both.
Required Associated Constants§
Provided Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_words_fn(f: impl FnMut(usize) -> Self::Word) -> Self
fn from_words_fn(f: impl FnMut(usize) -> Self::Word) -> Self
Build a block word by word, lowest bits first.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".