data-proc 0.1.0

A data processing pipeline framework with Source, Transformer, and Sink traits
Documentation
use std::io::Error;

use futures::Stream;

pub trait Source<T> {
    fn into_stream(self) -> impl Stream<Item = T>;
}

pub trait Transformer<T, U> {
    fn proc<S>(&self, stream: S) -> impl std::future::Future<Output = impl Stream<Item = U>> + Send
    where
        S: Stream<Item = T> + Send;
}

pub trait Sink<T> {
    fn sink<S>(&self, stream: S) -> impl std::future::Future<Output = Result<(), Error>> + Send
    where
        S: Stream<Item = T> + Send;
}