#![no_std]
use futures_lite::Stream;
pub use self::{
features::{
coalesce::{Coalesce, Dedup, DedupBy, coalesce, dedup, dedup_by},
zip_longest::zip_longest,
},
types::either_or_both::EitherOrBoth,
};
mod features;
mod internal;
mod types;
pub trait AsyncItertools: Stream {
fn zip_longest<U>(self, other: U) -> ZipLongest<Self, U>
where
Self: Sized,
U: Stream,
{
zip_longest(self, other)
}
fn coalesce<F>(self, f: F) -> Coalesce<Self, F>
where
Self: Sized,
F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,
{
coalesce(self, f)
}
fn dedup_by<F>(self, f: F) -> DedupBy<Self, F>
where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> bool,
{
dedup_by(self, f)
}
fn dedup(self) -> Dedup<Self>
where
Self: Sized,
Self::Item: PartialEq,
{
dedup(self)
}
}
impl<T: ?Sized + Stream> AsyncItertools for T {}
pub type ZipLongest<L, R> = self::features::zip_longest::ZipLongest<L, R>;