glue/pipeline/
pipeline_layer.rs1use std::error::Error;
2use std::thread::JoinHandle;
3
4pub trait PipelineLayer<T: Sync + Send + 'static> {
5 fn to<R: Sync + Send + 'static, C>(self, c: C) -> impl PipelineLayer<R>
6 where
7 C: Fn(T) -> Result<R, Box<dyn Error>> + Sync + Send + 'static;
8
9 fn map_to<R: Sync + Send + 'static, C>(self, c: C) -> impl PipelineLayer<R>
10 where
11 C: Fn(T) -> Vec<R> + Sync + Send + 'static;
12
13 fn finish<C>(self, c: C) -> Vec<JoinHandle<()>>
14 where
15 C: FnMut(T) -> Result<(), Box<dyn Error>> + Send + 'static;
16}