[−][src]Struct bitmaps::Bitmap
A compact array of bits.
The type used to store the bitmap will be the minimum unsigned integer type
required to fit the number of bits, from u8
to u128
. If the size is 1,
bool
is used. If the size exceeds 128, an array of u128
will be used,
sized as appropriately. The maximum supported size is currently 1024,
represented by an array [u128; 8]
.
Methods
impl Bitmap<U128>
[src]
pub unsafe fn load_m128i(&self) -> __m128i
[src]
sse2
only.impl Bitmap<U256>
[src]
pub unsafe fn load_m128i(&self) -> [__m128i; 2]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> __m256i
[src]
avx
only.impl Bitmap<U512>
[src]
pub unsafe fn load_m128i(&self) -> [__m128i; 4]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> [__m256i; 2]
[src]
avx
only.impl Bitmap<U768>
[src]
pub unsafe fn load_m128i(&self) -> [__m128i; 6]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> [__m256i; 3]
[src]
avx
only.impl Bitmap<U1024>
[src]
pub unsafe fn load_m128i(&self) -> [__m128i; 8]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> [__m256i; 4]
[src]
avx
only.impl<Size: Bits> Bitmap<Size>
[src]
pub fn new() -> Self
[src]
Construct a bitmap with every bit set to false
.
pub fn from_value(data: Size::Store) -> Self
[src]
Construct a bitmap from a value of the same type as its backing store.
pub fn into_value(self) -> Size::Store
[src]
Convert this bitmap into a value of the type of its backing store.
pub fn len(self) -> usize
[src]
Count the number of true
bits in the bitmap.
pub fn is_empty(self) -> bool
[src]
Test if the bitmap contains only false
bits.
pub fn get(self, index: usize) -> bool
[src]
Get the value of the bit at a given index.
pub fn set(&mut self, index: usize, value: bool) -> bool
[src]
Set the value of the bit at a given index.
Returns the previous value of the bit.
pub fn first_index(self) -> Option<usize>
[src]
Find the index of the first true
bit in the bitmap.
Trait Implementations
impl<Size: Bits> Default for Bitmap<Size>
[src]
impl Into<[u128; 2]> for Bitmap<U256>
[src]
impl Into<[u128; 3]> for Bitmap<U384>
[src]
impl Into<[u128; 4]> for Bitmap<U512>
[src]
impl Into<[u128; 5]> for Bitmap<U640>
[src]
impl Into<[u128; 6]> for Bitmap<U768>
[src]
impl Into<[u128; 7]> for Bitmap<U896>
[src]
impl Into<[u128; 8]> for Bitmap<U1024>
[src]
impl Into<__m128i> for Bitmap<U128>
[src]
impl Into<__m256i> for Bitmap<U256>
[src]
impl<Size: Bits> Clone for Bitmap<Size>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Size: Bits> PartialEq<Bitmap<Size>> for Bitmap<Size>
[src]
impl<Size: Bits> IntoIterator for Bitmap<Size>
[src]
type Item = usize
The type of the elements being iterated over.
type IntoIter = Iter<Size>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl From<[u128; 2]> for Bitmap<U256>
[src]
impl From<[u128; 3]> for Bitmap<U384>
[src]
impl From<[u128; 4]> for Bitmap<U512>
[src]
impl From<[u128; 5]> for Bitmap<U640>
[src]
impl From<[u128; 6]> for Bitmap<U768>
[src]
impl From<[u128; 7]> for Bitmap<U896>
[src]
impl From<[u128; 8]> for Bitmap<U1024>
[src]
impl From<__m128i> for Bitmap<U128>
[src]
impl From<__m256i> for Bitmap<U256>
[src]
impl<Size: Bits> Copy for Bitmap<Size>
[src]
impl<Size: Bits> Debug for Bitmap<Size>
[src]
Auto Trait Implementations
impl<Size> Unpin for Bitmap<Size> where
<Size as Bits>::Store: Unpin,
<Size as Bits>::Store: Unpin,
impl<Size> Sync for Bitmap<Size> where
<Size as Bits>::Store: Sync,
<Size as Bits>::Store: Sync,
impl<Size> Send for Bitmap<Size> where
<Size as Bits>::Store: Send,
<Size as Bits>::Store: Send,
impl<Size> UnwindSafe for Bitmap<Size> where
<Size as Bits>::Store: UnwindSafe,
<Size as Bits>::Store: UnwindSafe,
impl<Size> RefUnwindSafe for Bitmap<Size> where
<Size as Bits>::Store: RefUnwindSafe,
<Size as Bits>::Store: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self