1mod private
3{
4 #[ allow( unused_imports ) ]
5 use crate :: *;
6 #[ cfg( feature = "iter_trait" ) ]
9 use clone_dyn_types ::CloneDyn;
10
11 #[ cfg( feature = "iter_trait" ) ]
63 pub trait _IterTrait< 'a, T >
64 where
65 T: 'a,
66 Self: Iterator< Item = T > + ExactSizeIterator< Item = T > + DoubleEndedIterator,
67 Self: CloneDyn,
68 {
69 }
70
71 #[ cfg( feature = "iter_trait" ) ]
72 impl< 'a, T, I > _IterTrait< 'a, T > for I
73 where
74 T: 'a,
75 Self: Iterator< Item = T > + ExactSizeIterator< Item = T > + DoubleEndedIterator,
76 Self: CloneDyn,
77 {
78 }
79
80 #[ cfg( feature = "iter_trait" ) ]
90 pub trait IterTrait< 'a, T >
91 where
92 T: 'a,
93 Self: _IterTrait< 'a, T > + Clone,
94 {
95 }
96
97 #[ cfg( feature = "iter_trait" ) ]
98 impl< 'a, T, I > IterTrait< 'a, T > for I
99 where
100 T: 'a,
101 Self: _IterTrait< 'a, T > + Clone,
102 {
103 }
104
105 #[ cfg( feature = "iter_trait" ) ]
109 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
110 #[ allow( non_local_definitions ) ]
111 impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + 'c>
112{
113 #[ inline ]
114 fn clone( &self ) -> Self
115 {
116 clone_dyn_types ::clone_into_box(&**self)
117 }
118 }
119
120 #[ cfg( feature = "iter_trait" ) ]
121 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
122 #[ allow( non_local_definitions ) ]
123 impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Send + 'c>
124{
125 #[ inline ]
126 fn clone( &self ) -> Self
127 {
128 clone_dyn_types ::clone_into_box(&**self)
129 }
130 }
131
132 #[ cfg( feature = "iter_trait" ) ]
133 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
134 #[ allow( non_local_definitions ) ]
135 impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Sync + 'c>
136{
137 #[ inline ]
138 fn clone( &self ) -> Self
139 {
140 clone_dyn_types ::clone_into_box(&**self)
141 }
142 }
143
144 #[ cfg( feature = "iter_trait" ) ]
145 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
146 #[ allow( non_local_definitions ) ]
147 impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Send + Sync + 'c>
148{
149 #[ inline ]
150 fn clone( &self ) -> Self
151 {
152 clone_dyn_types ::clone_into_box(&**self)
153 }
154 }
155
156 #[ cfg( feature = "iter_trait" ) ]
161 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
162 pub type BoxedIter< 'a, T > = Box< dyn _IterTrait<'a, T > + 'a>;
163
164 #[ cfg( feature = "iter_ext" ) ]
167 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
168 pub trait IterExt
169 where
170 Self: core ::iter ::Iterator,
171 {
172 fn map_result< F, RE, El >(self, f: F) -> core ::result ::Result< Vec< El >, RE>
176 where
177 Self: Sized + Clone,
178 F: FnMut(< Self as core ::iter ::Iterator > ::Item) -> core ::result ::Result< El, RE >,
179 RE: core ::fmt ::Debug;
180 }
181
182 #[ cfg( feature = "iter_ext" ) ]
183 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
184 impl< Iterator > IterExt for Iterator
185 where
186 Iterator: core ::iter ::Iterator,
187 {
188 fn map_result< F, RE, El >(self, f: F) -> core ::result ::Result< Vec< El >, RE>
189 where
190 Self: Sized + Clone,
191 F: FnMut(< Self as core ::iter ::Iterator > ::Item) -> core ::result ::Result< El, RE >,
192 RE: core ::fmt ::Debug,
193 {
194 let vars_maybe = self.map(f);
195 let vars: Vec< _ > = ::itertools ::process_results(vars_maybe, |iter| iter.collect())?;
196 Ok(vars)
197 }
198 }
199}
200
201#[ doc( inline ) ]
202#[ allow( unused_imports ) ]
203pub use own :: *;
204
205#[ allow( unused_imports ) ]
207pub mod own
208{
209
210 use super :: *;
211 #[ doc( inline ) ]
212 pub use orphan :: *;
213}
214
215#[ allow( unused_imports ) ]
217pub mod orphan
218{
219
220 use super :: *;
221
222 #[ doc( inline ) ]
223 pub use exposed :: *;
224
225 #[ doc( inline ) ]
226 pub use ::itertools :: {
227 all,
228 any,
229 assert_equal,
230 chain,
231 cloned,
232 concat,
233 cons_tuples,
234 diff_with,
235 enumerate,
236 equal,
237 fold,
238 interleave,
239 intersperse,
240 intersperse_with,
241 iterate,
242 join,
243 kmerge,
244 kmerge_by,
245 max,
246 merge,
247 merge_join_by,
248 min,
249 multipeek,
250 multiunzip,
251 multizip,
252 partition,
253 peek_nth,
254 process_results,
255 put_back,
256 put_back_n,
257 rciter,
258 repeat_n,
259 rev,
260 sorted,
261 unfold,
262 zip_eq,
264 Itertools,
265 };
266
267 #[ cfg(not(feature = "no_std")) ]
268 #[ doc( inline ) ]
269 pub use core ::iter ::zip;
270}
271
272#[ allow( unused_imports ) ]
274pub mod exposed
275{
276
277 use super :: *;
278
279 #[ doc( inline ) ]
280 pub use prelude :: *;
281
282 #[ doc( inline ) ]
283 #[ cfg( feature = "iter_trait" ) ]
284 pub use private :: { _IterTrait, IterTrait };
285
286 #[ doc( inline ) ]
287 #[ cfg( feature = "iter_trait" ) ]
288 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
289 pub use private ::BoxedIter;
290}
291
292#[ allow( unused_imports ) ]
294pub mod prelude
295{
296
297 use super :: *;
298
299 #[ doc( inline ) ]
300 pub use ::itertools :: { Diff, Either, EitherOrBoth, FoldWhile, MinMaxResult, Position, Itertools, PeekingNext };
301
302 #[ doc( inline ) ]
303 #[ cfg( feature = "iter_ext" ) ]
304 #[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
305 pub use private ::IterExt;
306}