[][src]Struct bitmaps::Bitmap

pub struct Bitmap<Size: Bits> { /* fields omitted */ }

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]

This is supported with target feature sse2 only.

impl Bitmap<U256>[src]

pub unsafe fn load_m128i(&self) -> [__m128i; 2][src]

This is supported with target feature sse2 only.

pub unsafe fn load_m256i(&self) -> __m256i[src]

This is supported with target feature avx only.

impl Bitmap<U512>[src]

pub unsafe fn load_m128i(&self) -> [__m128i; 4][src]

This is supported with target feature sse2 only.

pub unsafe fn load_m256i(&self) -> [__m256i; 2][src]

This is supported with target feature avx only.

impl Bitmap<U768>[src]

pub unsafe fn load_m128i(&self) -> [__m128i; 6][src]

This is supported with target feature sse2 only.

pub unsafe fn load_m256i(&self) -> [__m256i; 3][src]

This is supported with target feature avx only.

impl Bitmap<U1024>[src]

pub unsafe fn load_m128i(&self) -> [__m128i; 8][src]

This is supported with target feature sse2 only.

pub unsafe fn load_m256i(&self) -> [__m256i; 4][src]

This is supported with target feature 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.

impl<Size: Bits> BitAndAssign<Bitmap<Size>> for Bitmap<Size>[src]

impl<Size: Bits> BitOr<Bitmap<Size>> for Bitmap<Size>[src]

type Output = Self

The resulting type after applying the | operator.

impl<Size: Bits> BitOrAssign<Bitmap<Size>> for Bitmap<Size>[src]

impl<Size: Bits> BitXor<Bitmap<Size>> for Bitmap<Size>[src]

type Output = Self

The resulting type after applying the ^ operator.

impl<Size: Bits> BitXorAssign<Bitmap<Size>> for Bitmap<Size>[src]

impl<Size: Bits> Clone for Bitmap<Size>[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?

impl<Size: Bits> Not for Bitmap<Size>[src]

type Output = Self

The resulting type after applying the ! operator.

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

impl<Size> Send for Bitmap<Size> where
    <Size as Bits>::Store: Send

impl<Size> Sync for Bitmap<Size> where
    <Size as Bits>::Store: Sync

impl<Size> Unpin for Bitmap<Size> where
    <Size as Bits>::Store: Unpin

impl<Size> UnwindSafe for Bitmap<Size> where
    <Size as Bits>::Store: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.