pub struct BitSlice<'a> { /* private fields */ }
Expand description
Slice of bits. This type is used to mark Resource
args
in imported / exported functions.
Implementations§
Source§impl<'a> BitSlice<'a>
impl<'a> BitSlice<'a>
Sourcepub fn is_set(&self, idx: usize) -> bool
pub fn is_set(&self, idx: usize) -> bool
Checks if a bit with the specified 0-based index is set.
Sourcepub fn set_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn set_indices(&self) -> impl Iterator<Item = usize> + '_
Iterates over the indexes of set bits in this slice.
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Returns the number of set bits in this slice.
Trait Implementations§
impl<'a> Copy for BitSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for BitSlice<'a>
impl<'a> RefUnwindSafe for BitSlice<'a>
impl<'a> Send for BitSlice<'a>
impl<'a> Sync for BitSlice<'a>
impl<'a> Unpin for BitSlice<'a>
impl<'a> UnwindSafe for BitSlice<'a>
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