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]
fn new() -> Self
Creates an empty IdSet
.
fn new_filled(n: usize) -> Self
Creates a IdSet
filled with all elements from 0 to n.
fn with_capacity(n: usize) -> Self
Creates a empty IdSet
that can hold elements up to n before reallocating.
fn from_bytes(bytes: &[u32]) -> Self
Creates a set from a raw set of bytes.
fn len(&self) -> usize
Returns the number of elements in the set.
fn clear(&mut self)
Removes all elements from the set.
fn insert(&mut self, id: Id) -> bool
Inserts the given elements into the set, returning true if it was not already in the set.
fn remove(&mut self, id: Id) -> bool
Removes the given element from the set, returning true if it was in the set.
fn contains(&self, id: Id) -> bool
Returns true if the given element is in the set.
fn retain<F: FnMut(Id) -> bool>(&mut self, pred: F)
Remove all elements that don't satisfy the predicate.
fn iter(&self) -> Iter
An iterator over all elements in increasing order.
fn into_iter(self) -> IntoIter
A consuming iterator over all elements in increasing order.
Trait Implementations
impl Clone for IdSet
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for IdSet
[src]
impl Default for IdSet
[src]
impl Eq for IdSet
[src]
impl PartialEq for IdSet
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Extend<Id> for IdSet
[src]
fn extend<I: IntoIterator<Item = Id>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Id> for IdSet
[src]
fn from_iter<I: IntoIterator<Item = Id>>(iter: I) -> Self
Creates a value from an iterator. Read more