macro_rules! define_take_items_impl {
($($bounds:tt)*) => {
use fluxion_core::StreamItem;
use futures::{Stream, StreamExt};
pub trait TakeItemsExt<T>: Stream<Item = StreamItem<T>> + Sized {
fn take_items(self, n: usize) -> impl Stream<Item = StreamItem<T>> + $($bounds)*;
}
impl<S, T> TakeItemsExt<T> for S
where
S: Stream<Item = StreamItem<T>> + $($bounds)*,
{
fn take_items(self, n: usize) -> impl Stream<Item = StreamItem<T>> + $($bounds)* {
StreamExt::take(self, n)
}
}
};
}