pub trait Mask:
PrimInt
+ ConstZero
+ ConstOne
+ Bounded
+ Euclid {
const ALL_SELECTED: Self;
const NONE_SELECTED: Self;
const ONE_SELECTED: Self;
const MAX_SELECTIONS: u32;
// Required method
fn mask_to_indices(self) -> impl Iterator<Item = usize>;
// Provided method
fn index_to_mask(index: usize) -> Self { ... }
}Expand description
An integer mask trait
Required Associated Constants§
Sourceconst ALL_SELECTED: Self
const ALL_SELECTED: Self
An instance of the mask with all indices selected.
Sourceconst NONE_SELECTED: Self
const NONE_SELECTED: Self
An instance of the mask with no indices selected.
Sourceconst ONE_SELECTED: Self
const ONE_SELECTED: Self
An instance of the mask with the lowest index (1) selected.
Sourceconst MAX_SELECTIONS: u32
const MAX_SELECTIONS: u32
The number of bits in the mask
Required Methods§
Sourcefn mask_to_indices(self) -> impl Iterator<Item = usize>
fn mask_to_indices(self) -> impl Iterator<Item = usize>
Convert this mask into an iterator of indices.
Provided Methods§
Sourcefn index_to_mask(index: usize) -> Self
fn index_to_mask(index: usize) -> Self
Convert an index into an instance of this mask.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.