Struct hibitset::AtomicBitSet [] [src]

pub struct AtomicBitSet { /* fields omitted */ }

This is similar to a BitSet but allows setting of value without unique ownership of the structure

An AtomicBitSet has the ability to add an item to the set without unique ownership (given that the set is big enough). Removing elements does require unique ownership as an effect of the hierarchy it holds. Worst case multiple writers set the same bit twice (but only is told they set it).

It is possible to atomically remove from the set, but not at the same time as atomically adding. This is because there is no way to know if layer 1-3 would be left in a consistent state if they are being cleared and set at the same time.

AtromicBitSet resolves this race by disallowing atomic clearing of bits.

Methods

impl AtomicBitSet
[src]

[src]

Creates an empty AtomicBitSet.

[src]

Adds id to the AtomicBitSet. Returns true if the value was already in the set.

Because we cannot safely extend an AtomicBitSet without unique ownership this will panic if the Index is out of range.

[src]

Adds id to the BitSet. Returns true if the value was already in the set.

[src]

Removes id from the set, returns true if the value was removed, and false if the value was not set to begin with.

[src]

Returns true if id is in the set.

[src]

Clear all bits in the set

Trait Implementations

impl Debug for AtomicBitSet
[src]

[src]

Formats the value using the given formatter.

impl BitSetLike for AtomicBitSet
[src]

[src]

Return a usize where each bit represents if any word in layer2 has been set. Read more

[src]

Return the usize from the array of usizes that indicates if any bit has been set in layer1 Read more

[src]

Return the usize from the array of usizes that indicates if any bit has been set in layer0 Read more

[src]

Return a usize that maps to the direct 1:1 association with each index of the set Read more

[src]

Allows checking if set bit is contained in the bit set.

[src]

Create an iterator that will scan over the keyspace

[src]

Create a parallel iterator that will scan over the keyspace

impl Default for AtomicBitSet
[src]

[src]

Returns the "default value" for a type. Read more

impl IntoIterator for AtomicBitSet
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl Not for AtomicBitSet
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl<T> BitAnd<T> for AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl<T> BitOr<T> for AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl<T> BitXor<T> for AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl<'a> IntoIterator for &'a AtomicBitSet
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a> Not for &'a AtomicBitSet
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl<'a, T> BitAnd<T> for &'a AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl<'a, T> BitOr<T> for &'a AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl<'a, T> BitXor<T> for &'a AtomicBitSet where
    T: BitSetLike
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl FromIterator<u32> for AtomicBitSet
[src]

[src]

Creates a value from an iterator. Read more

impl<'a> FromIterator<&'a u32> for AtomicBitSet
[src]

[src]

Creates a value from an iterator. Read more

impl Extend<u32> for AtomicBitSet
[src]

[src]

Extends a collection with the contents of an iterator. Read more

impl<'a> Extend<&'a u32> for AtomicBitSet
[src]

[src]

Extends a collection with the contents of an iterator. Read more