| Item | type Item = &'a str | - | Тип элементов, по которым выполняется итерация |
| next | fn next(&mut self) -> Option<&'a str> | let next_part = split_inclusive.next(); | Продвигает итератор и возвращает следующее значение |
| next_chunk | fn next_chunk<const N: usize>(&mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> | let chunk: [&str; 3] = split_inclusive.next_chunk()?; | 🔬 Возвращает массив следующих N значений |
| size_hint | fn size_hint(&self) -> (usize, Option<usize>) | let (min, max) = split_inclusive.size_hint(); | Возвращает границы оставшейся длины итератора |
| count | fn count(self) -> usize | let total = split_inclusive.count(); | Потребляет итератор, подсчитывая количество итераций |
| last | fn last(self) -> Option<Self::Item> | let final_part = split_inclusive.last(); | Потребляет итератор, возвращая последний элемент |
| advance_by | fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> | split_inclusive.advance_by(2)?; | 🔬 Продвигает итератор на n элементов |
| nth | fn nth(&mut self, n: usize) -> Option<Self::Item> | let third = split_inclusive.nth(2); | Возвращает n-й элемент итератора |
| step_by (с версии 1.28.0) | fn step_by(self, step: usize) -> StepBy<Self> ⓘ | let stepped = split_inclusive.step_by(2); | Создает итератор с заданным шагом |
| chain | fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter> ⓘ | let combined = split_inclusive.chain(other_split); | Объединяет два итератора в последовательности |
| zip | fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter> ⓘ | let zipped = split_inclusive.zip(other_split); | Объединяет два итератора в итератор пар |
| intersperse | fn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ | let with_sep = split_inclusive.intersperse(", "); | 🔬 Разделяет элементы разделителем |
| intersperse_with | fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ | `let with_sep = split_inclusive.intersperse_with( | |
| map | fn map<B, F>(self, f: F) -> Map<Self, F> ⓘ | `let lengths = split_inclusive.map( | s |
| for_each (с версии 1.21.0) | fn for_each<F>(self, f: F) | `split_inclusive.for_each( | s |
| filter | fn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘ | `let long = split_inclusive.filter( | s |
| filter_map | fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘ | `let nums = split_inclusive.filter_map( | s |
| enumerate | fn enumerate(self) -> Enumerate<Self> ⓘ | for (i, s) in split_inclusive.enumerate() | Добавляет индекс к каждому элементу |
| peekable | fn peekable(self) -> Peekable<Self> ⓘ | let peekable = split_inclusive.peekable(); | Создает итератор с возможностью заглядывания вперед |
| skip_while | fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘ | `let skipped = split_inclusive.skip_while( | s |
| take_while | fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘ | `let taken = split_inclusive.take_while( | s |
| map_while (с версии 1.57.0) | fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘ | `let nums = split_inclusive.map_while( | s |
| skip | fn skip(self, n: usize) -> Skip<Self> ⓘ | let skipped = split_inclusive.skip(2); | Пропускает первые n элементов |
| take | fn take(self, n: usize) -> Take<Self> ⓘ | let first_3 = split_inclusive.take(3); | Берет первые n элементов |
| scan | fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘ | `let scanned = split_inclusive.scan(0, | sum, s |
| flat_map | fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ | `let chars = split_inclusive.flat_map( | s |
| flatten (с версии 1.29.0) | fn flatten(self) -> Flatten<Self> ⓘ | let flattened = split_inclusive.flatten(); | Разворачивает вложенные структуры |
| map_windows | fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ | `let windows = split_inclusive.map_windows( | arr: &[&str; 3] |
| fuse | fn fuse(self) -> Fuse<Self> ⓘ | let fused = split_inclusive.fuse(); | Создает итератор, завершающийся после первого None |
| inspect | fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ | `let inspected = split_inclusive.inspect( | s |
| by_ref | fn by_ref(&mut self) -> &mut Self | for s in split_inclusive.by_ref().take(2) | Создает ссылку на итератор |
| collect | fn collect<B>(self) -> B | let vec: Vec<&str> = split_inclusive.collect(); | Преобразует итератор в коллекцию |
| try_collect | fn try_collect<B>(&mut self) -> ... | let vec: Vec<Result<&str, _>> = split_inclusive.try_collect(); | 🔬 Преобразует итератор с обработкой ошибок |
| collect_into | fn collect_into<E>(self, collection: &mut E) -> &mut E | split_inclusive.collect_into(&mut vec); | 🔬 Собирает элементы в существующую коллекцию |
| partition | fn partition<B, F>(self, f: F) -> (B, B) | `let (long, short): (Vec<>, Vec<>) = split_inclusive.partition( | s |
| partition_in_place | fn partition_in_place<'a, T, P>(self, predicate: P) -> usize | `let true_count = split_inclusive.partition_in_place( | s |
| is_partitioned | fn is_partitioned<P>(self, predicate: P) -> bool | `let partitioned = split_inclusive.is_partitioned( | s |
| try_fold (с версии 1.27.0) | fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R | `let sum = split_inclusive.try_fold(0, | acc, s |
| try_for_each (с версии 1.27.0) | fn try_for_each<F, R>(&mut self, f: F) -> R | `split_inclusive.try_for_each( | s |
| fold | fn fold<B, F>(self, init: B, f: F) -> B | `let total_len = split_inclusive.fold(0, | acc, s |
| reduce (с версии 1.51.0) | fn reduce<F>(self, f: F) -> Option<Self::Item> | `let longest = split_inclusive.reduce( | a, b |
| try_reduce | fn try_reduce<R>(&mut self, f: impl FnMut(Self::Item, Self::Item) -> R) -> ... | `let longest = split_inclusive.try_reduce( | a, b |
| all | fn all<F>(&mut self, f: F) -> bool | `let all_long = split_inclusive.all( | s |
| any | fn any<F>(&mut self, f: F) -> bool | `let any_long = split_inclusive.any( | s |
| find | fn find<P>(&mut self, predicate: P) -> Option<Self::Item> | `let long = split_inclusive.find( | s |
| find_map (с версии 1.30.0) | fn find_map<B, F>(&mut self, f: F) -> Option<B> | `let num = split_inclusive.find_map( | s |
| try_find | fn try_find<R>(&mut self, f: impl FnMut(&Self::Item) -> R) -> ... | `let long = split_inclusive.try_find( | s |
| position | fn position<P>(&mut self, predicate: P) -> Option<usize> | `let pos = split_inclusive.position( | s |
| rposition | fn rposition<P>(&mut self, predicate: P) -> Option<usize> | `let rpos = split_inclusive.rposition( | s |
| max | fn max(self) -> Option<Self::Item> | let longest = split_inclusive.max(); | Возвращает максимальный элемент |
| min | fn min(self) -> Option<Self::Item> | let shortest = split_inclusive.min(); | Возвращает минимальный элемент |
| max_by_key (с версии 1.6.0) | fn max_by_key<B, F>(self, f: F) -> Option<Self::Item> | `let longest = split_inclusive.max_by_key( | s |
| max_by (с версии 1.15.0) | fn max_by<F>(self, compare: F) -> Option<Self::Item> | `let longest = split_inclusive.max_by( | a, b |
| min_by_key (с версии 1.6.0) | fn min_by_key<B, F>(self, f: F) -> Option<Self::Item> | `let shortest = split_inclusive.min_by_key( | s |
| min_by (с версии 1.15.0) | fn min_by<F>(self, compare: F) -> Option<Self::Item> | `let shortest = split_inclusive.min_by( | a, b |
| rev | fn rev(self) -> Rev<Self> ⓘ | let reversed = split_inclusive.rev(); | Обращает направление итератора |
| unzip | fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) | let (first, second): (Vec<_>, Vec<_>) = split_inclusive.unzip(); | Разделяет пары на две коллекции |
| copied (с версии 1.36.0) | fn copied<'a, T>(self) -> Copied<Self> ⓘ | let copied: Copied<_> = split_inclusive.copied(); | Создает итератор, копирующий элементы |
| cloned | fn cloned<'a, T>(self) -> Cloned<Self> ⓘ | let cloned: Cloned<_> = split_inclusive.cloned(); | Создает итератор, клонирующий элементы |
| cycle | fn cycle(self) -> Cycle<Self> ⓘ | let cycled = split_inclusive.cycle(); | Бесконечно повторяет итератор |
| array_chunks | fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘ | let chunks = split_inclusive.array_chunks::<3>(); | 🔬 Возвращает элементы массивами по N штук |
| sum (с версии 1.11.0) | fn sum<S>(self) -> S | `let total_len: usize = split_inclusive.map( | s |
| product (с версии 1.11.0) | fn product<P>(self) -> P | `let product: i32 = split_inclusive.map( | s |
| cmp (с версии 1.5.0) | fn cmp<I>(self, other: I) -> Ordering | let ordering = split_inclusive.cmp(other_split); | Лексикографически сравнивает с другим итератором |
| cmp_by | fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering | `let ordering = split_inclusive.cmp_by(other_split, | a, b |
| partial_cmp (с версии 1.5.0) | fn partial_cmp<I>(self, other: I) -> Option<Ordering> | let ordering = split_inclusive.partial_cmp(other_split); | Частично сравнивает с другим итератором |
| partial_cmp_by | fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering> | `let ordering = split_inclusive.partial_cmp_by(other_split, | a, b |
| eq (с версии 1.5.0) | fn eq<I>(self, other: I) -> bool | let equal = split_inclusive.eq(other_split); | Проверяет равенство элементов |
| eq_by | fn eq_by<I, F>(self, other: I, eq: F) -> bool | `let equal = split_inclusive.eq_by(other_split, | a, b |
| ne (с версии 1.5.0) | fn ne<I>(self, other: I) -> bool | let not_equal = split_inclusive.ne(other_split); | Проверяет неравенство элементов |
| lt (с версии 1.5.0) | fn lt<I>(self, other: I) -> bool | let less = split_inclusive.lt(other_split); | Проверяет, меньше ли элементы |
| le (с версии 1.5.0) | fn le<I>(self, other: I) -> bool | let less_equal = split_inclusive.le(other_split); | Проверяет, меньше или равны ли элементы |
| gt (с версии 1.5.0) | fn gt<I>(self, other: I) -> bool | let greater = split_inclusive.gt(other_split); | Проверяет, больше ли элементы |
| ge (с версии 1.5.0) | fn ge<I>(self, other: I) -> bool | let greater_equal = split_inclusive.ge(other_split); | Проверяет, больше или равны ли элементы |
| is_sorted (с версии 1.82.0) | fn is_sorted(self) -> bool | let sorted = split_inclusive.is_sorted(); | Проверяет, отсортированы ли элементы |
| is_sorted_by (с версии 1.82.0) | fn is_sorted_by<F>(self, compare: F) -> bool | `let sorted = split_inclusive.is_sorted_by( | a, b |
| is_sorted_by_key (с версии 1.82.0) | fn is_sorted_by_key<F, K>(self, f: F) -> bool | `let sorted = split_inclusive.is_sorted_by_key( | s |