Struct id_set::IdSet [] [src]

pub struct IdSet { /* fields omitted */ }

A set of usize elements represented by a bit vector. Storage required is proportional to the maximum element in the set.

Methods

impl IdSet
[src]

Creates an empty IdSet.

Creates a IdSet filled with all elements from 0 to n.

Creates a empty IdSet that can hold elements up to n before reallocating.

Returns the number of distinct elements in the set.

Returns true if the set is empty.

Returns capacity of the set. Inserting any elements less than this will not cause reallocation.

Resizes the set such that capacity() >= cap.

Resizes the set to minimise allocations.

Removes all elements from the set.

Inserts the given elements into the set, returning true if it was not already in the set.

Removes the given element from the set, returning true if it was in the set.

Returns true if the given element is in the set.

Remove all elements that don't satisfy the predicate.

Returns a slice of the underlying blocks.

An iterator over all elements in increasing order.

Returns an iterator over the blocks of the underlying representation.

Returns a consuming iterator over the blocks of the underlying representation.

Takes the union of the set with another. Equivalent to self | other.

Takes the intersection of the set with another. Equivalent to self & other.

Takes the difference of the set with another. Equivalent to self - other.

Takes the symmetric difference of the set with another. Equivalent to self ^ other.

Consumes the set and takes the union with another.

Consumes the set and takes the intersection with another.

Consumes the set and takes the difference with another.

Consumes the set and takes the symmetric difference with another.

Take the union of the set inplace with another set. Equivalent to *self |= other.

Take the intersection of the set inplace with another set. Equivalent to *self &= other.

Take the difference of the set inplace with another set. Equivalent to *self -= other.

Take the symmetric difference of the set inplace with another set. Equivalent to *self ^= other.

Returns true if the sets are disjoint.

Returns true if self is a superset of other.

Returns true if self is a subset of other.

Trait Implementations

impl Clone for IdSet
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for IdSet
[src]

Formats the value using the given formatter.

impl Default for IdSet
[src]

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

impl Eq for IdSet
[src]

impl PartialEq for IdSet
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Extend<Id> for IdSet
[src]

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

impl FromIterator<Id> for IdSet
[src]

Creates a value from an iterator. Read more

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl IntoIterator for IdSet
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a> IntoBlockIter for &'a IdSet
[src]

The raw iterator type.

Creates a block iterator.

impl IntoBlockIter for IdSet
[src]

The raw iterator type.

Creates a block iterator.

impl<'a, I> BitAnd<I> for &'a IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the & operator

Takes the intersection of two objects.

impl<'a, I> BitOr<I> for &'a IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the | operator

Takes the union of two objects.

impl<'a, I> BitXor<I> for &'a IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the ^ operator

Takes the symmetric difference of two objects.

impl<'a, I> Sub<I> for &'a IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the - operator

Takes the difference of two objects.

impl<I> BitAnd<I> for IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the & operator

Takes the intersection of two objects.

impl<I> BitOr<I> for IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the | operator

Takes the union of two objects.

impl<I> BitXor<I> for IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the ^ operator

Takes the symmetric difference of two objects.

impl<I> Sub<I> for IdSet where
    I: IntoBlockIter
[src]

The resulting type after applying the - operator

Takes the difference of two objects.

impl<I> BitAndAssign<I> for IdSet where
    I: IntoBlockIter
[src]

Takes the inplace intersection of the set with another.

impl<I> BitOrAssign<I> for IdSet where
    I: IntoBlockIter
[src]

Takes the inplace union of the set with another.

impl<I> BitXorAssign<I> for IdSet where
    I: IntoBlockIter
[src]

Takes the inplace symmetric difference of the set with another.

impl<I> SubAssign<I> for IdSet where
    I: IntoBlockIter
[src]

Takes the inplace difference of the set with another.