[][src]Function mogwai::txrx::txrx_fold

pub fn txrx_fold<A, B, T, F>(t: T, f: F) -> (Transmitter<A>, Receiver<B>) where
    A: 'static,
    B: 'static,
    T: 'static,
    F: Fn(&mut T, &A) -> B + 'static, 

Create a linked Transmitter<A> and Receiver<B> pair with internal state.

Using the given fold function, messages sent on the transmitter will be folded into the given internal state and all output messages will be sent to the receiver.