Trait eclectic::set::Remove
[−]
[src]
pub trait Remove<Q: ?Sized = Self::Item>: Get<Q> + Remove { fn take(&mut self, item: &Q) -> Option<Self::Item>; fn remove(&mut self, item: &Q) -> bool { ... } }
A set that supports removal using items of type &Q
.
Required Methods
fn take(&mut self, item: &Q) -> Option<Self::Item>
Removes and returns the item in the set that is equivalent to the given item.
Returns None
if the set contained no such item.
Provided Methods
fn remove(&mut self, item: &Q) -> bool
Removes the item in the set that is equivalent to the given item.
Returns true
if the set contained such an item, false
otherwise.
This is equivalent to self.take(item).is_some()
, but may be optimized.