Macro mpstthree::offer_mpst_c_to_b

source ·
macro_rules! offer_mpst_c_to_b {
    ($session: expr, { $( $pat: pat => $result: block , )+ }) => { ... };
}
Expand description

Offer a choice to C from B between many different sessions wrapped in an enum

§Arguments

  • The session to be used
  • Each path, which are each variant of the enum which contains the new branches
  • The block of code to process each new session

§Example

offer_mpst_c_to_b!(s, {
   CBranchesCtoB::End(s) => {
       close_mpst(s)
   },
   CBranchesCtoB::Video(s) => {
       let (request, s) = recv_mpst_c_from_b(s)?;
       let s = send_mpst_c_to_a(request + 1, s);
       let (video, s) = recv_mpst_c_from_a(s)?;
       let s = send_mpst_c_to_b(video + 1, s);
       authenticator_recurs(s)
   },
})?;