Add Flatten struct

yoshuawuyts-patch-1
k-nasa 5 years ago
parent 2187a2a31d
commit cd862083a5

@ -39,6 +39,21 @@ where
}
}
pub struct Flatten<S: Stream>
where
S::Item: IntoStream,
{
inner: FlattenCompat<S, <S::Item as IntoStream>::IntoStream>,
}
impl<S: Stream<Item: IntoStream>> Flatten<S> {
pin_utils::unsafe_pinned!(inner: FlattenCompat<S, <S::Item as IntoStream>::IntoStream>);
pub fn new(stream: S) -> Flatten<S> {
Flatten { inner: FlattenCompat::new(stream) }
}
}
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
/// this type.
#[derive(Clone, Debug)]

Loading…
Cancel
Save