Struct david_set::CastSet
[−]
[src]
pub struct CastSet<T: Cast> { /* fields omitted */ }
A set implemented for types that can be cast to usize
Methods
impl<T: Cast> CastSet<T>
[src]
fn new() -> CastSet<T>
Creates an empty set..
fn with_capacity(cap: usize) -> CastSet<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 + Cast> Debug for CastSet<T>
[src]
impl<T: Clone + Cast> Clone for CastSet<T>
[src]
fn clone(&self) -> CastSet<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