diff options
Diffstat (limited to 'src/libstd/iterator.rs')
| -rw-r--r-- | src/libstd/iterator.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index a6460935a50..2ec8ea41bfb 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -32,6 +32,12 @@ pub trait FromIterator<A, T: Iterator<A>> { fn from_iterator(iterator: &mut T) -> Self; } +/// A type growable from an `Iterator` implementation +pub trait Extendable<A, T: Iterator<A>>: FromIterator<A, T> { + /// Extend a container with the elements yielded by an iterator + fn extend(&mut self, iterator: &mut T); +} + /// An interface for dealing with "external iterators". These types of iterators /// can be resumed at any time as all state is stored internally as opposed to /// being located on the call stack. |
