data_proc/
lib.rs

1use std::io::Error;
2
3use futures::Stream;
4
5pub trait Source<T> {
6    fn into_stream(self) -> impl Stream<Item = T>;
7}
8
9pub trait Transformer<T, U> {
10    fn proc<S>(&self, stream: S) -> impl std::future::Future<Output = impl Stream<Item = U>> + Send
11    where
12        S: Stream<Item = T> + Send;
13}
14
15pub trait Sink<T> {
16    fn sink<S>(&self, stream: S) -> impl std::future::Future<Output = Result<(), Error>> + Send
17    where
18        S: Stream<Item = T> + Send;
19}