pub struct BitVec<T, U: Integer>{ /* private fields */ }Implementations§
Source§impl<T, U: Integer> BitVec<T, U>
impl<T, U: Integer> BitVec<T, U>
Sourcepub fn comp_pos(&self, i: usize) -> (usize, usize, usize, usize)
pub fn comp_pos(&self, i: usize) -> (usize, usize, usize, usize)
Returns the positions of the affected elements in the underlying values vec and the local start and end bit.
Sourcepub fn with_max_value(n: usize, val_max: T) -> Self
pub fn with_max_value(n: usize, val_max: T) -> Self
Returns a bit vec container with a maximum value. Internal variables are set, such that the underlying data vec does not have to be reallocated.
Sourcepub fn stride_bits(&self) -> u64
pub fn stride_bits(&self) -> u64
Returns the number of bits for each integer in the underlying vec.
Sourcepub fn mask(&self, start_bit: usize, end_bit: usize) -> U
pub fn mask(&self, start_bit: usize, end_bit: usize) -> U
Returns the mask filled with ones from start_bit to end_bit.
Sourcepub fn mask_inverse(&self, start_bit: usize, end_bit: usize) -> U
pub fn mask_inverse(&self, start_bit: usize, end_bit: usize) -> U
Returns the mask filled with zeroes from start_bit to end_bit, all the other bits are ones.
Trait Implementations§
Source§impl<T, U: Integer> VecLike for BitVec<T, U>
impl<T, U: Integer> VecLike for BitVec<T, U>
type Type = T
Source§fn with_capacity(n: usize) -> Self
fn with_capacity(n: usize) -> Self
Creates a vector like object with capacity.
Source§fn iter_values(&self) -> impl Iterator<Item = T>
fn iter_values(&self) -> impl Iterator<Item = T>
Returns an iterator over all values.
Source§fn get_checked(&self, i: usize) -> Result<Self::Type, CompVecError>
fn get_checked(&self, i: usize) -> Result<Self::Type, CompVecError>
Returns entry at position i as value with bounds check beforehand.
Source§fn set_checked(&mut self, i: usize, val: Self::Type) -> Result<(), CompVecError>
fn set_checked(&mut self, i: usize, val: Self::Type) -> Result<(), CompVecError>
Sets entry at position i with value val with bounds check beforehand.
Source§fn insert(&mut self, index: usize, element: Self::Type)
fn insert(&mut self, index: usize, element: Self::Type)
Inserts an element at index.
This operation may be inefficient, since the vector needs to be restructured.
Source§fn remove(&mut self, index: usize) -> Self::Type
fn remove(&mut self, index: usize) -> Self::Type
Removes an element at index.
This operation may be inefficient, since the vector needs to be restructured.
Source§fn extend_from_slice(&mut self, other: &[Self::Type])
fn extend_from_slice(&mut self, other: &[Self::Type])
Appends all elements from the slice.
Source§fn swap_remove(&mut self, index: usize) -> Self::Type
fn swap_remove(&mut self, index: usize) -> Self::Type
Swaps the last element with index and resizes vec.
Returns the removed element at index.
Auto Trait Implementations§
impl<T, U> Freeze for BitVec<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for BitVec<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for BitVec<T, U>
impl<T, U> Sync for BitVec<T, U>
impl<T, U> Unpin for BitVec<T, U>
impl<T, U> UnwindSafe for BitVec<T, U>where
T: UnwindSafe,
U: 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