mod private
{
#[ allow( unused_imports ) ]
use crate:: *;
#[ cfg( feature = "iter_trait" ) ]
use clone_dyn_types::CloneDyn;
#[ cfg( feature = "iter_trait" ) ]
pub trait _IterTrait< 'a, T >
where
T: 'a,
Self: Iterator< Item = T > + ExactSizeIterator< Item = T > + DoubleEndedIterator,
Self: CloneDyn,
{
}
#[ cfg( feature = "iter_trait" ) ]
impl< 'a, T, I > _IterTrait< 'a, T > for I
where
T: 'a,
Self: Iterator< Item = T > + ExactSizeIterator< Item = T > + DoubleEndedIterator,
Self: CloneDyn,
{
}
#[ cfg( feature = "iter_trait" ) ]
pub trait IterTrait< 'a, T >
where
T: 'a,
Self: _IterTrait< 'a, T > + Clone,
{
}
#[ cfg( feature = "iter_trait" ) ]
impl< 'a, T, I > IterTrait< 'a, T > for I
where
T: 'a,
Self: _IterTrait< 'a, T > + Clone,
{
}
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
#[ allow( non_local_definitions ) ]
impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + 'c>
{
#[ inline ]
fn clone( &self ) -> Self
{
clone_dyn_types::clone_into_box(&**self)
}
}
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
#[ allow( non_local_definitions ) ]
impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Send + 'c>
{
#[ inline ]
fn clone( &self ) -> Self
{
clone_dyn_types::clone_into_box(&**self)
}
}
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
#[ allow( non_local_definitions ) ]
impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Sync + 'c>
{
#[ inline ]
fn clone( &self ) -> Self
{
clone_dyn_types::clone_into_box(&**self)
}
}
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
#[ allow( non_local_definitions ) ]
impl< 'c, T > Clone for Box< dyn _IterTrait<'c, T > + Send + Sync + 'c>
{
#[ inline ]
fn clone( &self ) -> Self
{
clone_dyn_types::clone_into_box(&**self)
}
}
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
pub type BoxedIter< 'a, T > = Box< dyn _IterTrait<'a, T > + 'a>;
#[ cfg( feature = "iter_ext" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
pub trait IterExt
where
Self: core::iter::Iterator,
{
fn map_result< F, RE, El >(self, f: F) -> core::result::Result< Vec< El >, RE>
where
Self: Sized + Clone,
F: FnMut(< Self as core::iter::Iterator >::Item) -> core::result::Result< El, RE >,
RE: core::fmt::Debug;
}
#[ cfg( feature = "iter_ext" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
impl< Iterator > IterExt for Iterator
where
Iterator: core::iter::Iterator,
{
fn map_result< F, RE, El >(self, f: F) -> core::result::Result< Vec< El >, RE>
where
Self: Sized + Clone,
F: FnMut(< Self as core::iter::Iterator >::Item) -> core::result::Result< El, RE >,
RE: core::fmt::Debug,
{
let vars_maybe = self.map(f);
let vars: Vec< _ > =::itertools::process_results(vars_maybe, |iter| iter.collect())?;
Ok(vars)
}
}
}
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own:: *;
#[ allow( unused_imports ) ]
pub mod own
{
use super:: *;
#[ doc( inline ) ]
pub use orphan:: *;
}
#[ allow( unused_imports ) ]
pub mod orphan
{
use super:: *;
#[ doc( inline ) ]
pub use exposed:: *;
#[ doc( inline ) ]
pub use::itertools:: {
all,
any,
assert_equal,
chain,
cloned,
concat,
cons_tuples,
diff_with,
enumerate,
equal,
fold,
interleave,
intersperse,
intersperse_with,
iterate,
join,
kmerge,
kmerge_by,
max,
merge,
merge_join_by,
min,
multipeek,
multiunzip,
multizip,
partition,
peek_nth,
process_results,
put_back,
put_back_n,
rciter,
repeat_n,
rev,
sorted,
unfold,
zip_eq,
Itertools,
};
#[ doc( inline ) ]
pub use core::iter::zip;
}
#[ allow( unused_imports ) ]
pub mod exposed
{
use super:: *;
#[ doc( inline ) ]
pub use prelude:: *;
#[ doc( inline ) ]
#[ cfg( feature = "iter_trait" ) ]
pub use private:: { _IterTrait, IterTrait };
#[ doc( inline ) ]
#[ cfg( feature = "iter_trait" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
pub use private::BoxedIter;
}
#[ allow( unused_imports ) ]
pub mod prelude
{
use super:: *;
#[ doc( inline ) ]
pub use::itertools:: { Diff, Either, EitherOrBoth, FoldWhile, MinMaxResult, Position, Itertools, PeekingNext };
#[ doc( inline ) ]
#[ cfg( feature = "iter_ext" ) ]
#[ cfg(any(not(feature = "no_std"), feature = "use_alloc")) ]
pub use private::IterExt;
}