pub(crate) fn over<P, Tx, Rx, T, F, Fut>(tx: Tx, rx: Rx, with_chan: F) -> Over<Tx, Rx, T, Fut>
where
    P: Session,
    Tx: std::marker::Send + 'static,
    Rx: std::marker::Send + 'static,
    F: FnOnce(Chan<P, Tx, Rx>) -> Fut,
    Fut: Future<Output = T>,
{
    let drop_tx = Arc::new(Mutex::new(Err(IncompleteHalf::Unclosed)));
    let drop_rx = Arc::new(Mutex::new(Err(IncompleteHalf::Unclosed)));
    let reclaimed_tx = drop_tx.clone();
    let reclaimed_rx = drop_rx.clone();
    let chan = Chan {
        tx: Some(tx),
        rx: Some(rx),
        drop_tx,
        drop_rx,
        session: PhantomData,
    };
    Over {
        future: with_chan(chan),
        reclaimed_tx,
        reclaimed_rx,
    }
}
/// The implementation of `Session::over`. This has to be defined here because it uses the internals
/// of `Chan`.
The implementation of `Session::over`. This has to be defined here because it uses the internals
of `Chan`.
The implementation of ` Session :: over ` . This has to be defined here because it uses the internals of ` Chan ` .
pub(crate) fn over<P, Tx, Rx, T, F, Fut>(tx: Tx, rx: Rx, with_chan: F) -> Over<Tx, Rx, T, Fut>
where
    P: Session,
    Tx: std::marker::Send + 'static,
    Rx: std::marker::Send + 'static,
    F: FnOnce(Chan<P, Tx, Rx>) -> Fut,
    Fut: Future<Output = T>,
{
    let drop_tx = Arc::new(Mutex::new(Err(IncompleteHalf::Unclosed)));
    let drop_rx = Arc::new(Mutex::new(Err(IncompleteHalf::Unclosed)));
    let reclaimed_tx = drop_tx.clone();
    let reclaimed_rx = drop_rx.clone();
    let chan = Chan {
        tx: Some(tx),
        rx: Some(rx),
        drop_tx,
        drop_rx,
        session: PhantomData,
    };
    Over {
        future: with_chan(chan),
        reclaimed_tx,
        reclaimed_rx,
    }
}
pub ( crate ) fn over < P , Tx , Rx , T , F , Fut > ( tx : Tx , rx : Rx , with_chan : F ) -> Over < Tx , Rx , T , Fut > where P : Session , Tx : std :: marker :: Send + ' static , Rx : std :: marker :: Send + ' static , F : FnOnce ( Chan < P , Tx , Rx > ) -> Fut , Fut : Future < Output = T > , { let drop_tx = Arc :: new ( Mutex :: new ( Err ( IncompleteHalf :: Unclosed ) ) ) ; let drop_rx = Arc :: new ( Mutex :: new ( Err ( IncompleteHalf :: Unclosed ) ) ) ; let reclaimed_tx = drop_tx . clone ( ) ; let reclaimed_rx = drop_rx . clone ( ) ; let chan = Chan { tx : Some ( tx ) , rx : Some ( rx ) , drop_tx , drop_rx , session : PhantomData , } ; Over { future : with_chan ( chan ) , reclaimed_tx , reclaimed_rx , } }
The implementation of `Session::over`.
The implementation of ` Session :: over ` .
tx
Tx
rx
Rx
with_chan
F