pub struct BitSet<B: BitOps = u32>(/* private fields */);Expand description
Wraps an integer type B to treat it as a set of bit flags.
Implementations§
Source§impl<B: BitOps> BitSet<B>
impl<B: BitOps> BitSet<B>
Sourcepub fn from_indices<I: IntoIterator<Item = u32>>(indices: I) -> Self
pub fn from_indices<I: IntoIterator<Item = u32>>(indices: I) -> Self
Return a bit set with given indices set.
Sourcepub fn count_true(&self) -> u32
pub fn count_true(&self) -> u32
Return the number of bits set.
Trait Implementations§
impl<B: Copy + BitOps> Copy for BitSet<B>
impl<B: PartialEq + BitOps> StructuralPartialEq for BitSet<B>
Auto Trait Implementations§
impl<B> Forget for BitSet<B>
impl<B> Freeze for BitSet<B>where
B: Freeze,
impl<B> RefUnwindSafe for BitSet<B>where
B: RefUnwindSafe,
impl<B> Send for BitSet<B>where
B: Send,
impl<B> Sync for BitSet<B>where
B: Sync,
impl<B> Unpin for BitSet<B>where
B: Unpin,
impl<B> UnsafeUnpin for BitSet<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for BitSet<B>where
B: 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