Macro mpstthree::choose_mpst_multi_to_all[][src]

macro_rules! choose_mpst_multi_to_all {
    ($session : expr, $($label : path,) + => $($receiver : ident,) + => $sender :
 ident, $meshedchannels_name : ident, $exclusion : literal) => { ... };
}
Expand description

Choose among different sessions that are provided.

Arguments

  • The session to be used
  • The different enum variants which represent the different branches to be sent to each passive role
  • The different passive roles
  • The name of the sender
  • The name of the MeshedChannels type that will be used
  • The index of the active role

Example

Available on the cases/13_macro_multi_recursion test.

match xs.pop() {
   Option::Some(_) => {
       let s = choose_mpst_multi_to_all!(
           s,
           CBranchesAtoC::Video,
           CBranchesBtoC::Video, =>
           RoleA,
           RoleB, =>
           RoleD,
           MeshedChannels,
           3
       );
       let s = send_mpst_d_to_a(1, s);
       let (_, s) = recv_mpst_d_from_a(s)?;
       client_recurs(s, xs, index + 1)
   }
   Option::None => {
       let s = choose_mpst_multi_to_all!(
           s,
           CBranchesAtoC::End,
           CBranchesBtoC::End, =>
           RoleA,
           RoleB, =>
           RoleD,
           MeshedChannels,
           3
       );
       close_mpst_multi(s)
   }
}