[][src]Function mogwai::txrx::txrx_fold_shared

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

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

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