futures_concurrency/concurrent_stream/into_concurrent_stream.rs
1use super::ConcurrentStream;
2
3/// Conversion into a [`ConcurrentStream`]
4pub trait IntoConcurrentStream {
5 /// The type of the elements being iterated over.
6 type Item;
7 /// Which kind of iterator are we turning this into?
8 type IntoConcurrentStream: ConcurrentStream<Item = Self::Item>;
9
10 /// Convert `self` into a concurrent iterator.
11 fn into_co_stream(self) -> Self::IntoConcurrentStream;
12}
13
14impl<S: ConcurrentStream> IntoConcurrentStream for S {
15 type Item = S::Item;
16 type IntoConcurrentStream = S;
17
18 fn into_co_stream(self) -> Self::IntoConcurrentStream {
19 self
20 }
21}