Trait eclectic::DrainRange [] [src]

pub trait DrainRange<R>: Collection {
    fn drain_range<'a>(&'a mut self, range: R) -> Box<Iterator<Item=Self::Item> + 'a> where Self: AddRemove;

A collection that supports draining a range of its items.

Required Methods

Removes all items from the collection that lie in the given range and returns an iterator that yields them.

All items in the given range are removed even if the iterator is not exhausted. However, the behavior of this method is unspecified if the iterator is leaked (e.g. via mem::forget).

The iteration order is unspecified, but subtraits may place a requirement on it.