Struct tinyset::tinyset::TinySet
[−]
[src]
pub struct TinySet<T: HasInvalid> { /* fields omitted */ }
A set implemented for types that have an invalid value
Methods
impl<T: HasInvalid> TinySet<T>
[src]
fn default() -> TinySet<T>
Creates an empty set..
fn new() -> TinySet<T>
Creates an empty set..
fn with_capacity(cap: usize) -> TinySet<T>
Creates an empty set with the specified capacity.
fn len(&self) -> usize
Returns the number of elements in the set.
fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be
inserted in the set. The collection may reserve more space
to avoid frequent reallocations.
fn insert(&mut self, elem: T) -> bool
Adds a value to the set.
If the set did not have this value present, true
is returned.
If the set did have this value present, false
is returned.
fn contains(&self, value: &T) -> bool
Returns true if the set contains a value.
fn remove(&mut self, value: &T) -> bool
Removes an element, and returns true if that element was present.
fn iter(&self) -> Iter<T>
Returns an iterator over the set.
fn drain(&mut self) -> IntoIter<T>
Clears the set, returning all elements in an iterator.
Trait Implementations
impl<T: Debug + HasInvalid> Debug for TinySet<T>
[src]
impl<T: Clone + HasInvalid> Clone for TinySet<T>
[src]
fn clone(&self) -> TinySet<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more