atomr_streams/bidi.rs
1//! BidiFlow — composed of two flows in opposite directions.
2
3use crate::flow::Flow;
4
5pub struct BidiFlow<In1, Out1, In2, Out2> {
6 pub forward: Flow<In1, Out1>,
7 pub backward: Flow<In2, Out2>,
8}
9
10impl<In1, Out1, In2, Out2> BidiFlow<In1, Out1, In2, Out2>
11where
12 In1: Send + 'static,
13 Out1: Send + 'static,
14 In2: Send + 'static,
15 Out2: Send + 'static,
16{
17 pub fn from_flows(forward: Flow<In1, Out1>, backward: Flow<In2, Out2>) -> Self {
18 Self { forward, backward }
19 }
20}