devela/data/iter/
reexports.rs

1// devela::data::iter::reexports
2//
3//! Reexported items from `core`.
4//
5// - WAIT: [iter_map_windows](https://github.com/rust-lang/rust/issues/87155)
6// - WAIT: [iter_array_chunks](https://github.com/rust-lang/rust/issues/100450)
7// - WAIT: [iter_intersperse](https://github.com/rust-lang/rust/issues/79524)
8// - WAIT: [step_trait](https://github.com/rust-lang/rust/issues/42168)
9// - WAIT: [trusted_len](https://github.com/rust-lang/rust/issues/37572)
10// - WAIT: [trusted_step](https://github.com/rust-lang/rust/issues/85731)
11// - WAIT: [iter_from_coroutine](https://github.com/rust-lang/rust/issues/43122) TODO nightly
12
13use crate::code::reexport;
14
15/* core types */
16
17reexport! { rust: core::iter,
18    tag: crate::TAG_ITERATOR!(),
19    doc: "An iterator that links two iterators together, in a chain.",
20    @Chain as IterChain
21}
22reexport! { rust: core::iter,
23    tag: crate::TAG_ITERATOR!(),
24    doc: "An iterator that clones the elements of an underlying iterator.",
25    @Cloned as IterCloned
26}
27reexport! { rust: core::iter,
28    tag: crate::TAG_ITERATOR!(),
29    doc: "An iterator that copies the elements of an underlying iterator.",
30    @Copied as IterCopied
31}
32reexport! { rust: core::iter,
33    tag: crate::TAG_ITERATOR!(),
34    doc: "An iterator that repeats endlessly.",
35    @Cycle as IterCycle
36}
37reexport! { rust: core::iter,
38    tag: crate::TAG_ITERATOR!(),
39    doc: "An iterator that yields nothing.",
40    @Empty as IterEmpty
41}
42reexport! { rust: core::iter,
43    tag: crate::TAG_ITERATOR!(),
44    doc: "An iterator that yields the current count and the element during iteration.",
45    @Enumerate as IterEnumerate
46}
47reexport! { rust: core::iter,
48    tag: crate::TAG_ITERATOR!(),
49    doc: "An iterator that filters the elements of `iter` with `predicate`.",
50    @Filter as IterFilter
51}
52reexport! { rust: core::iter,
53    tag: crate::TAG_ITERATOR!(),
54    doc: "An iterator that uses `f` to both filter and map elements from `iter`.",
55    @FilterMap as IterFilterMap
56}
57reexport! { rust: core::iter,
58    tag: crate::TAG_ITERATOR!(),
59    doc: "An iterator that maps each element to an iterator, and yields their elements.",
60    @FlatMap as IterFlatMap
61}
62reexport! { rust: core::iter,
63    tag: crate::TAG_ITERATOR!(),
64    doc: "An iterator that flattens one level of nesting in an iterator of iterables.",
65    @Flatten as IterFlatten
66}
67reexport! { rust: core::iter,
68    tag: crate::TAG_ITERATOR!(),
69    doc: "An iterator where each iteration calls a closure `F: FnMut() -> Option<T>`.",
70    @FromFn as IterFromFn
71}
72reexport! { rust: core::iter,
73    tag: crate::TAG_ITERATOR!(),
74    doc: "An iterator that yields `None` forever after the underlying yields `None` once.",
75    @Fuse as IterFuse
76}
77reexport! { rust: core::iter,
78    tag: crate::TAG_ITERATOR!(),
79    doc: "An iterator that calls a fn with a reference to each element before yielding it.",
80    @Inspect as IterInspect
81}
82reexport! { rust: core::iter,
83    tag: crate::TAG_ITERATOR!(),
84    doc: "An iterator that maps the values of iter with `f`.",
85    @Map as IterMap
86}
87reexport! { rust: core::iter,
88    tag: crate::TAG_ITERATOR!(),
89    doc: "An iterator that only accepts elements while `predicate` returns `Some(_)`.",
90    @MapWhile as IterMapWhile
91}
92reexport! { rust: core::iter,
93    tag: crate::TAG_ITERATOR!(),
94    doc: "An iterator that yields an element exactly once.",
95    @Once as IterOnce
96}
97reexport! { rust: core::iter,
98    tag: crate::TAG_ITERATOR!(),
99    doc: "An iterator that yields a single element `A` by calling `F: FnOnce() -> A`.",
100    @OnceWith as IterOnceWith
101}
102reexport! { rust: core::iter,
103    tag: crate::TAG_ITERATOR!(),
104    doc: "An iterator with a `peek()` that returns an optional ref to the next element.",
105    @Peekable as IterPeekable
106}
107reexport! { rust: core::iter,
108    tag: crate::TAG_ITERATOR!(),
109    doc: "An iterator that repeats an element endlessly.",
110    @Repeat as IterRepeat
111}
112reexport! { rust: core::iter,
113    tag: crate::TAG_ITERATOR!(),
114    doc: "An iterator that repeats an element an exact number of times.",
115    @RepeatN as IterRepeatN
116}
117reexport! { rust: core::iter,
118    tag: crate::TAG_ITERATOR!(),
119    doc: "An iterator that endlessly repeats `A` by calling `F: FnMut() -> A`.",
120    @RepeatWith as IterRepeatWith
121}
122reexport! { rust: core::iter,
123    tag: crate::TAG_ITERATOR!(),
124    doc: "A double-ended iterator with the direction inverted.",
125    @Rev as IterRev
126}
127reexport! { rust: core::iter,
128    tag: crate::TAG_ITERATOR!(),
129    doc: "An iterator to maintain state while iterating another iterator.",
130    @Scan as IterScan
131}
132reexport! { rust: core::iter,
133    tag: crate::TAG_ITERATOR!(),
134    doc: "An iterator that skips over `n` elements of `iter`.",
135    @Skip as IterSkip
136}
137reexport! { rust: core::iter,
138    tag: crate::TAG_ITERATOR!(),
139    doc: "An iterator that rejects elements while `predicate` returns `true`.",
140    @SkipWhile as IterSkipWhile
141}
142reexport! { rust: core::iter,
143    tag: crate::TAG_ITERATOR!(),
144    doc: "An iterator for stepping iterators by a custom amount.",
145    @StepBy as IterStepBy
146}
147reexport! { rust: core::iter,
148    tag: crate::TAG_ITERATOR!(),
149    doc: "An iterator where each successive item is computed based on the preceding one.",
150    @Successors as IterSuccessors
151}
152reexport! { rust: core::iter,
153    tag: crate::TAG_ITERATOR!(),
154    doc: "An iterator that only iterates over the first `n` iterations of `iter`.",
155    @Take as IterTake
156}
157reexport! { rust: core::iter,
158    tag: crate::TAG_ITERATOR!(),
159    doc: "An iterator that only accepts elements while `predicate` returns `true`.",
160    @TakeWhile as IterTakeWhile
161}
162reexport! { rust: core::iter,
163    tag: crate::TAG_ITERATOR!(),
164    doc: "An iterator that iterates two other iterators simultaneously.",
165    @Zip as IterZip
166}
167
168/* core traits */
169
170reexport! { rust: core::iter,
171    tag: crate::TAG_ITERATOR!(),
172    doc: "An iterator able to yield elements from both ends.",
173    @DoubleEndedIterator as IteratorDoubleEnded
174}
175reexport! { rust: core::iter,
176    tag: crate::TAG_ITERATOR!(),
177    doc: "An iterator that knows its exact length.",
178    @ExactSizeIterator as IteratorExactSize
179}
180reexport! { rust: core::iter,
181    tag: crate::TAG_ITERATOR!(),
182    doc: "Extend a collection with the contents of an iterator.",
183    @Extend as IteratorExtend
184}
185reexport! { rust: core::iter,
186    tag: crate::TAG_ITERATOR!(),
187    doc: "Conversion from an [`Iterator`].",
188    @FromIterator as IteratorFrom
189}
190reexport! { rust: core::iter,
191    tag: crate::TAG_ITERATOR!(),
192    doc: "An iterator that always continues to yield `None` when exhausted.",
193    @FusedIterator as IteratorFused
194}
195reexport! { rust: core::iter,
196    tag: crate::TAG_ITERATOR!(),
197    doc: "Conversion into an [`Iterator`].",
198    @IntoIterator as IteratorInto
199}
200reexport! { rust: core::iter,
201    tag: crate::TAG_ITERATOR!(),
202    doc: "A trait for dealing with iterators.",
203    Iterator
204}
205reexport! { rust: core::iter,
206    tag: crate::TAG_ITERATOR!(),
207    doc: "Represents types that can be created by multiplying elements of an iterator.",
208    @Product as IteratorProduct
209}
210reexport! { rust: core::iter,
211    tag: crate::TAG_ITERATOR!(),
212    doc: "Represents types that can be created by summing up an iterator.",
213    @Sum as IteratorSum
214}
215
216/* core functions */
217
218// These are re-exported as methods of the Iter namespace.
219
220// WAIT: https://github.com/rust-lang/rust/pull/135687
221reexport! { rust: core::iter,
222    extra_features: "nightly_coro",
223    doc: "Creates an iterator where each iteration calls the provided coroutine.",
224    @from_coroutine as iter_from_coroutine
225}
226
227/* itertool items */
228
229reexport! { "dep_itertools", "itertools", itertools,
230    tag: crate::TAG_ITERATOR!(),
231    doc: "An [`Iterator`] blanket impl providing extra adaptors and methods.",
232    Itertools
233}
234reexport! { "dep_itertools", "itertools", itertools,
235    tag: crate::TAG_ITERATOR!(),
236    doc: "An iterator that can be unzipped into multiple collections.",
237    @MultiUnzip as IteratorMultiUnzip
238}
239reexport! { "dep_itertools", "itertools", itertools,
240    tag: crate::TAG_ITERATOR!(),
241    doc: "An iterator that allows peeking at an element before deciding to accept it.",
242    @PeekingNext as IteratorPeekingNext
243}