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 such that capacity() is minimal.

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.

An iterator over the blocks of the underlying representation.

A consuming iterator over the blocks of the underlying representation.

Iterator over the union of two sets. Equivalent to self.blocks().union(other.blocks()).into_id_iter().

Iterator over the intersection of two sets. Equivalent to self.blocks().intersection(other.blocks()).into_id_iter().

Iterator over the difference of two sets. Equivalent to self.blocks().difference(other.blocks()).into_id_iter().

Iterator over the symmetric difference of two sets. Equivalent to self.blocks().symmetric_difference(other.blocks()).into_id_iter().

Iterator over the complement of the set. This iterator will never return None.

Take the union of the set with another set.

Take the intersection of the set with another set.

Take the difference of the set with another set.

Take the symmetric difference of the set with another set.

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