Struct bitmaps::Bitmap [−][src]
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]
.
Implementations
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 mask(bits: usize) -> Self
[src]
Construct a bitmap where every bit with index less than bits
is
true
, and every other bit is 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.
pub fn invert(&mut self)
[src]
Invert all the bits in the bitmap.
Trait Implementations
impl<Size: Bits> BitAnd<Bitmap<Size>> for Bitmap<Size>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self::Output
[src]
impl<Size: Bits> BitAndAssign<Bitmap<Size>> for Bitmap<Size>
[src]
fn bitand_assign(&mut self, rhs: Self)
[src]
impl<Size: Bits> BitOr<Bitmap<Size>> for Bitmap<Size>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
impl<Size: Bits> BitOrAssign<Bitmap<Size>> for Bitmap<Size>
[src]
fn bitor_assign(&mut self, rhs: Self)
[src]
impl<Size: Bits> BitXor<Bitmap<Size>> for Bitmap<Size>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Self) -> Self::Output
[src]
impl<Size: Bits> BitXorAssign<Bitmap<Size>> for Bitmap<Size>
[src]
fn bitxor_assign(&mut self, rhs: Self)
[src]
impl<Size: Bits> Clone for Bitmap<Size>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Size: Bits> Copy for Bitmap<Size>
[src]
impl<Size: Bits> Debug for Bitmap<Size>
[src]
impl<Size: Bits> Default for Bitmap<Size>
[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 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<'a, Size: Bits> IntoIterator for &'a Bitmap<Size>
[src]
type Item = usize
The type of the elements being iterated over.
type IntoIter = Iter<'a, Size>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<Size: Bits> Not for Bitmap<Size>
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl<Size: Bits> PartialEq<Bitmap<Size>> for Bitmap<Size>
[src]
Auto Trait Implementations
impl<Size> RefUnwindSafe for Bitmap<Size> where
<Size as Bits>::Store: RefUnwindSafe,
<Size as Bits>::Store: RefUnwindSafe,
impl<Size> Send for Bitmap<Size> where
<Size as Bits>::Store: Send,
<Size as Bits>::Store: Send,
impl<Size> Sync for Bitmap<Size> where
<Size as Bits>::Store: Sync,
<Size as Bits>::Store: Sync,
impl<Size> Unpin for Bitmap<Size> where
<Size as Bits>::Store: Unpin,
<Size as Bits>::Store: Unpin,
impl<Size> UnwindSafe for Bitmap<Size> where
<Size as Bits>::Store: UnwindSafe,
<Size as Bits>::Store: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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>,