[][src]Struct specs::prelude::BitSet

pub struct BitSet { /* fields omitted */ }

A BitSet is a simple set designed to track which indices are placed into it.

Note, a BitSet is limited by design to only usize**4 indices. Adding beyond this limit will cause the BitSet to panic.

Methods

impl BitSet[src]

pub fn new() -> BitSet[src]

Creates an empty BitSet.

pub fn with_capacity(max: u32) -> BitSet[src]

Creates an empty BitSet, preallocated for up to max indices.

pub fn add(&mut self, id: u32) -> bool[src]

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

pub fn remove(&mut self, id: u32) -> bool[src]

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

pub fn contains(&self, id: u32) -> bool[src]

Returns true if id is in the set.

pub fn contains_set(&self, other: &BitSet) -> bool[src]

Returns true if all ids in other are contained in this set

pub fn clear(&mut self)[src]

Completely wipes out the bit set.

Trait Implementations

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

type Output = BitSetOr<&'a BitSet, T>

The resulting type after applying the | operator.

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

type Output = BitSetOr<BitSet, T>

The resulting type after applying the | operator.

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

impl Extend<u32> for BitSet[src]

impl<'a, B> BitOrAssign<&'a B> for BitSet where
    B: BitSetLike
[src]

impl Default for BitSet[src]

impl IntoIterator for BitSet[src]

type Item = <BitIter<BitSet> as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = BitIter<BitSet>

Which kind of iterator are we turning this into?

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

type Item = <BitIter<&'a BitSet> as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = BitIter<&'a BitSet>

Which kind of iterator are we turning this into?

impl DrainableBitSet for BitSet[src]

fn drain(&'a mut self) -> DrainBitIter<'a, Self>[src]

Create a draining iterator that will scan over the keyspace and clears it while doing so.

impl Eq for BitSet[src]

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

impl FromIterator<u32> for BitSet[src]

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

type Output = BitSetNot<&'a BitSet>

The resulting type after applying the ! operator.

impl Not for BitSet[src]

type Output = BitSetNot<BitSet>

The resulting type after applying the ! operator.

impl Debug for BitSet[src]

impl Clone for BitSet[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

type Output = BitSetXor<BitSet, T>

The resulting type after applying the ^ operator.

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

type Output = BitSetXor<&'a BitSet, T>

The resulting type after applying the ^ operator.

impl PartialEq<BitSet> for BitSet[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'a, B> BitAndAssign<&'a B> for BitSet where
    B: BitSetLike
[src]

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

type Output = BitSetAnd<&'a BitSet, T>

The resulting type after applying the & operator.

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

type Output = BitSetAnd<BitSet, T>

The resulting type after applying the & operator.

impl<'a, B> BitXorAssign<&'a B> for BitSet where
    B: BitSetLike
[src]

impl BitSetLike for BitSet[src]

fn get_from_layer(&self, layer: usize, idx: usize) -> usize[src]

Gets the usize corresponding to layer and index. Read more

fn is_empty(&self) -> bool[src]

Returns true if this BitSetLike contains nothing, and false otherwise.

fn iter(self) -> BitIter<Self>[src]

Create an iterator that will scan over the keyspace

fn par_iter(self) -> BitParIter<Self>[src]

Create a parallel iterator that will scan over the keyspace

impl ParJoin for BitSet[src]

fn par_join(self) -> JoinParIter<Self> where
    Self: Sized
[src]

Create a joined parallel iterator over the contents.

impl<'a> ParJoin for &'a BitSet[src]

fn par_join(self) -> JoinParIter<Self> where
    Self: Sized
[src]

Create a joined parallel iterator over the contents.

impl Join for BitSet[src]

type Type = Index

Type of joined components.

type Value = ()

Type of joined storages.

type Mask = BitSet

Type of joined bit mask.

Important traits for JoinIter<J>
fn join(self) -> JoinIter<Self> where
    Self: Sized
[src]

Create a joined iterator over the contents.

fn maybe(self) -> MaybeJoin<Self> where
    Self: Sized
[src]

Returns a Join-able structure that yields all indices, returning None for all missing elements and Some(T) for found elements. Read more

fn is_unconstrained() -> bool[src]

If this Join typically returns all indices in the mask, then iterating over only it or combined with other joins that are also dangerous will cause the JoinIter/ParJoin to go through all indices which is usually not what is wanted and will kill performance. Read more

impl<'a> Join for &'a BitSet[src]

type Type = Index

Type of joined components.

type Value = ()

Type of joined storages.

type Mask = &'a BitSet

Type of joined bit mask.

Important traits for JoinIter<J>
fn join(self) -> JoinIter<Self> where
    Self: Sized
[src]

Create a joined iterator over the contents.

fn maybe(self) -> MaybeJoin<Self> where
    Self: Sized
[src]

Returns a Join-able structure that yields all indices, returning None for all missing elements and Some(T) for found elements. Read more

fn is_unconstrained() -> bool[src]

If this Join typically returns all indices in the mask, then iterating over only it or combined with other joins that are also dangerous will cause the JoinIter/ParJoin to go through all indices which is usually not what is wanted and will kill performance. Read more

Auto Trait Implementations

impl Unpin for BitSet

impl Sync for BitSet

impl Send for BitSet

impl UnwindSafe for BitSet

impl RefUnwindSafe for BitSet

Blanket Implementations

impl<T> TryDefault for T where
    T: Default
[src]

fn unwrap_default() -> Self[src]

Calls try_default and panics on an error case.

impl<I> IntoIterator for I where
    I: Iterator
[src]

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?

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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

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

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

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]