Struct datazoo::enum_bitmatrix::EnumBitMatrix
source · pub struct EnumBitMatrix<R: EnumSetType>(/* private fields */);
Expand description
A bitset similar to BitMatrix
,
but with a fixed column and row count, indexed by R
EnumSetType
.
Implementations§
source§impl<R: EnumSetType> EnumBitMatrix<R>
impl<R: EnumSetType> EnumBitMatrix<R>
sourcepub fn set_row(&mut self, row: R, iter: impl Iterator<Item = u32>)
pub fn set_row(&mut self, row: R, iter: impl Iterator<Item = u32>)
Enable bits from iter
for given row
.
Note that items of iter
not within bit_width
are ignored,
and already enabled bits stay enabled.
sourcepub const fn bit_width(&self) -> u32
pub const fn bit_width(&self) -> u32
The width in bits of individual rows of this EnumBitMatrix
.
sourcepub fn row(
&self,
row: R,
range: Range<u32>
) -> impl SortedIterator<Item = u32> + '_
pub fn row( &self, row: R, range: Range<u32> ) -> impl SortedIterator<Item = u32> + '_
Iterate over enabled bits in row
, limited to provided range
.
If the range doesn’t fit within 0..bit_width
,
it will be truncated to fit within that range.
Trait Implementations§
source§impl<R: Clone + EnumSetType> Clone for EnumBitMatrix<R>
impl<R: Clone + EnumSetType> Clone for EnumBitMatrix<R>
source§fn clone(&self) -> EnumBitMatrix<R>
fn clone(&self) -> EnumBitMatrix<R>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<R: EnumSetType> Debug for EnumBitMatrix<R>
impl<R: EnumSetType> Debug for EnumBitMatrix<R>
source§impl<R: PartialEq + EnumSetType> PartialEq for EnumBitMatrix<R>
impl<R: PartialEq + EnumSetType> PartialEq for EnumBitMatrix<R>
source§fn eq(&self, other: &EnumBitMatrix<R>) -> bool
fn eq(&self, other: &EnumBitMatrix<R>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<R: Eq + EnumSetType> Eq for EnumBitMatrix<R>
impl<R: EnumSetType> StructuralEq for EnumBitMatrix<R>
impl<R: EnumSetType> StructuralPartialEq for EnumBitMatrix<R>
Auto Trait Implementations§
impl<R> RefUnwindSafe for EnumBitMatrix<R>where R: RefUnwindSafe,
impl<R> Send for EnumBitMatrix<R>where R: Send,
impl<R> Sync for EnumBitMatrix<R>where R: Sync,
impl<R> Unpin for EnumBitMatrix<R>where R: Unpin,
impl<R> UnwindSafe for EnumBitMatrix<R>where R: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more