Lines Matching refs:iterator

2100     /// removed elements as an iterator. If the iterator is dropped before
2103 /// The returned iterator keeps a mutable borrow on the vector to optimize
2113 /// If the returned iterator goes out of scope without being dropped (due to
2950 /// Creates a consuming iterator, that is, one that moves each value out of
3033 fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) {
3034 // This is the case for a general iterator.
3038 // for item in iterator {
3041 while let Some(element) = iterator.next() {
3044 let (lower, _) = iterator.size_hint();
3059 fn try_extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) -> Result<(), TryReserveError> {
3060 // This is the case for a general iterator.
3064 // for item in iterator {
3067 while let Some(element) = iterator.next() {
3070 let (lower, _) = iterator.size_hint();
3088 fn extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) {
3089 let (low, high) = iterator.size_hint();
3094 "TrustedLen iterator's size hint is not exact: {:?}",
3101 iterator.for_each(move |element| {
3110 // Per TrustedLen contract a `None` upper bound means that the iterator length
3121 fn try_extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) -> Result<(), TryReserveError> {
3122 let (low, high) = iterator.size_hint();
3127 "TrustedLen iterator's size hint is not exact: {:?}",
3134 iterator.for_each(move |element| {
3148 /// Creates a splicing iterator that replaces the specified range in the vector
3149 /// with the given `replace_with` iterator and yields the removed items.
3152 /// `range` is removed even if the iterator is not consumed until the end.
3157 /// The input iterator `replace_with` is only consumed when the `Splice` value is dropped.
3192 /// Creates an iterator which uses a closure to determine if an element should be removed.
3196 /// by the iterator.
3200 /// Use [`retain`] with a negated predicate if you do not need the returned iterator.