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<128>
[src]
impl Bitmap<128>
[src]pub unsafe fn load_m128i(&self) -> __m128i
[src]
sse2
only.impl Bitmap<256>
[src]
impl Bitmap<256>
[src]pub unsafe fn load_m128i(&self) -> [__m128i; 2]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> __m256i
[src]
avx
only.impl Bitmap<512>
[src]
impl Bitmap<512>
[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<768>
[src]
impl Bitmap<768>
[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<1024>
[src]
impl Bitmap<1024>
[src]pub unsafe fn load_m128i(&self) -> [__m128i; 8]
[src]
sse2
only.pub unsafe fn load_m256i(&self) -> [__m256i; 4]
[src]
avx
only.impl<const SIZE: usize> Bitmap<{ SIZE }> where
BitsImpl<SIZE>: Bits,
[src]
impl<const SIZE: usize> Bitmap<{ SIZE }> where
BitsImpl<SIZE>: Bits,
[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: <BitsImpl<SIZE> as Bits>::Store) -> Self
[src]
Construct a bitmap from a value of the same type as its backing store.
pub fn into_value(self) -> <BitsImpl<SIZE> as Bits>::Store
[src]
Convert this bitmap into a value of the type of its backing store.
pub fn as_value(&self) -> &<BitsImpl<SIZE> as Bits>::Store
[src]
Get a reference to this bitmap’s 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<const SIZE: usize> BitAnd<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitAnd<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]impl<const SIZE: usize> BitAndAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitAndAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]fn bitand_assign(&mut self, rhs: Self)
[src]
impl<const SIZE: usize> BitOr<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitOr<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]impl<const SIZE: usize> BitOrAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitOrAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]fn bitor_assign(&mut self, rhs: Self)
[src]
impl<const SIZE: usize> BitXor<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitXor<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]impl<const SIZE: usize> BitXorAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> BitXorAssign<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]fn bitxor_assign(&mut self, rhs: Self)
[src]
impl<const SIZE: usize> Clone for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> Clone for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<const SIZE: usize> Hash for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
<BitsImpl<{ SIZE }> as Bits>::Store: Hash,
[src]
impl<const SIZE: usize> Hash for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
<BitsImpl<{ SIZE }> as Bits>::Store: Hash,
[src]impl<'a, const SIZE: usize> IntoIterator for &'a Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<'a, const SIZE: usize> IntoIterator for &'a Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]impl<const SIZE: usize> Ord for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
<BitsImpl<{ SIZE }> as Bits>::Store: Ord,
[src]
impl<const SIZE: usize> Ord for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
<BitsImpl<{ SIZE }> as Bits>::Store: Ord,
[src]impl<const SIZE: usize> PartialEq<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]
impl<const SIZE: usize> PartialEq<Bitmap<SIZE>> for Bitmap<{ SIZE }> where
BitsImpl<{ SIZE }>: Bits,
[src]Auto Trait Implementations
impl<const SIZE: usize> !RefUnwindSafe for Bitmap<SIZE>
impl<const SIZE: usize> !RefUnwindSafe for Bitmap<SIZE>
impl<const SIZE: usize> !UnwindSafe for Bitmap<SIZE>
impl<const SIZE: usize> !UnwindSafe for Bitmap<SIZE>