Struct bit_matrix::row::BitSlice

source ·
pub struct BitSlice { /* private fields */ }
Expand description

A slice of bit vector’s blocks.

Implementations§

source§

impl BitSlice

source

pub fn new(slice: &[Block]) -> &Self

Creates a new slice from a slice of blocks.

source

pub fn new_mut(slice: &mut [Block]) -> &mut Self

Creates a new slice from a mutable slice of blocks.

source

pub fn iter_bits(&self, len: usize) -> Iter<'_>

Iterates over bits.

source

pub fn iter_blocks(&self) -> impl Iterator<Item = &Block>

Iterates over the slice’s blocks.

source

pub fn iter_blocks_mut(&mut self) -> impl Iterator<Item = &mut Block>

Iterates over the slice’s blocks, yielding mutable references.

source

pub fn get(&self, bit: usize) -> bool

Returns true if a bit is enabled in the bit vector slice, or false otherwise.

source

pub fn small_slice_aligned(&self, bit: usize, len: u8) -> u32

Returns a small integer-sized slice of the bit vector slice.

Trait Implementations§

source§

impl Index<usize> for BitSlice

Returns true if a bit is enabled in the bit vector slice, or false otherwise.

§

type Output = bool

The returned type after indexing.
source§

fn index(&self, bit: usize) -> &bool

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more