async fn read_chan<T, P, E, R: Repr<T>>(
    chan: &mut Chan<P, E, R>,
    timeout: Duration,
) -> SessionResult<T> {
    let msg = read_chan_dyn(chan, timeout).await?;
    downcast(msg)
}
/// Read a message then cast it to the expected type.
Read a message then cast it to the expected type.
Read a message then cast it to the expected type .
async fn read_chan<T, P, E, R: Repr<T>>(
    chan: &mut Chan<P, E, R>,
    timeout: Duration,
) -> SessionResult<T> {
    let msg = read_chan_dyn(chan, timeout).await?;
    downcast(msg)
}
async fn read_chan < T , P , E , R : Repr < T > > ( chan : & mut Chan < P , E , R > , timeout : Duration , ) -> SessionResult < T > { let msg = read_chan_dyn ( chan , timeout ) . await ? ; downcast ( msg ) }
Read a message then cast it to the expected type.
Read a message then cast it to the expected type .
chan
&mut Chan<P, E, R>
timeout
Duration