pub async fn offer(mut self, t: Duration) -> SessionResult<OfferBranch<P, Q, E, R>> {
        // The next message we read from the channel decides
        // which protocol we go with.
        let msg = match read_chan_dyn(&mut self, t).await {
            Ok(msg) => msg,
            Err(e) => {
                close_chan(self);
                return Err(e);
            }
        };

        // This variant casts then re-wraps.
        // match Repr::<P::Expected>::try_cast(msg) {
        //     Ok(exp) => Ok(Left(self.stash(exp.to_repr()).cast())),
        //     Err(msg) => Ok(Right(self.stash(msg).cast())),
        // }

        // This variant just checks, to avoid unwrapping and re-wrapping.
        if Repr::<P::Expected>::can_into(&msg) {
            Ok(Branch::Left(self.stash(msg).cast()))
        } else {
            Ok(Branch::Right(self.stash(msg).cast()))
        }
    }
/// Passive choice. This allows the other end of the channel to select one
/// of two options for continuing the protocol: either `P` or `Q`.
/// Both options mean they will have to send a message to us,
/// the agency is on their side.
Passive choice. This allows the other end of the channel to select one
of two options for continuing the protocol: either `P` or `Q`.
Both options mean they will have to send a message to us,
the agency is on their side.
Passive choice . This allows the other end of the channel to select one of two options for continuing the protocol : either ` P ` or ` Q ` . Both options mean they will have to send a message to us the agency is on their side .
pub async fn offer(mut self, t: Duration) -> SessionResult<OfferBranch<P, Q, E, R>> {
        // The next message we read from the channel decides
        // which protocol we go with.
        let msg = match read_chan_dyn(&mut self, t).await {
            Ok(msg) => msg,
            Err(e) => {
                close_chan(self);
                return Err(e);
            }
        };
        // This variant casts then re-wraps.
        // match Repr::<P::Expected>::try_cast(msg) {
        //     Ok(exp) => Ok(Left(self.stash(exp.to_repr()).cast())),
        //     Err(msg) => Ok(Right(self.stash(msg).cast())),
        // }
        // This variant just checks, to avoid unwrapping and re-wrapping.
        if Repr::<P::Expected>::can_into(&msg) {
            Ok(Branch::Left(self.stash(msg).cast()))
        } else {
            Ok(Branch::Right(self.stash(msg).cast()))
        }
    }
pub async fn offer ( mut self , t : Duration ) -> SessionResult < OfferBranch < P , Q , E , R > > { // The next message we read from the channel decides // which protocol we go with. let msg = match read_chan_dyn ( & mut self , t ) . await { Ok ( msg ) => msg , Err ( e ) => { close_chan ( self ) ; return Err ( e ) ; } } ; // This variant casts then re-wraps. // match Repr::<P::Expected>::try_cast(msg) { //     Ok(exp) => Ok(Left(self.stash(exp.to_repr()).cast())), //     Err(msg) => Ok(Right(self.stash(msg).cast())), // } // This variant just checks, to avoid unwrapping and re-wrapping. if Repr :: < P :: Expected > :: can_into ( & msg ) { Ok ( Branch :: Left ( self . stash ( msg ) . cast ( ) ) ) } else { Ok ( Branch :: Right ( self . stash ( msg ) . cast ( ) ) ) } }
Passive choice.
Passive choice .
mut self
t
Duration