Struct tinyset::vecset::VecSet
[−]
[src]
pub struct VecSet<T> { /* fields omitted */ }
A set that is stored in a Vec
Methods
impl<T: Eq> VecSet<T>
[src]
fn new() -> VecSet<T>
Creates an empty set..
fn default() -> VecSet<T>
Creates an empty set..
fn len(&self) -> usize
Returns the number of elements in the set.
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<Q: ?Sized>(&self, value: &Q) -> bool where
T: Borrow<Q>,
Q: Hash + Eq,
T: Borrow<Q>,
Q: Hash + Eq,
Returns true if the set contains a value.
fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool where
T: Borrow<Q>,
Q: Hash + Eq,
T: Borrow<Q>,
Q: Hash + Eq,
Removes an element, and returns true if that element was present.
fn iter(&self) -> Iter<T>
Returns an iterator over the set.
Trait Implementations
impl<T: Debug> Debug for VecSet<T>
[src]
impl<T: Clone> Clone for VecSet<T>
[src]
fn clone(&self) -> VecSet<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