Macro mpstthree::choose_mpst_to_all

source ·
macro_rules! choose_mpst_to_all {
    (
        $session: expr ,
        $( $label: path , )+ =>
        $name_sender: ident
    ) => { ... };
}
Available on crate feature macros_simple only.
Expand description

Choose among two different sessions. Must be used with MeshedChannels.

§Arguments

  • The session to be used
  • The first path to be sent
  • The second path to be sent
  • The send function to be used for the first path
  • The send function to be used for the second path
  • The first passive role
  • The second passive role
  • The active role

§Example

match xs.pop() {
    Option::Some(_) => {
        let s = choose_mpst_to_all!(
            s,
            CBranchesAtoC::Video,
            CBranchesBtoC::Video, =>
            RoleA,
            RoleB, =>
            RoleC
        );
        let s = send_mpst_c_to_a(1, s);
        let (_, s) = recv_mpst_c_from_a(s)?;
        client_recurs(s, xs, index + 1)
    }
    Option::None => {
        let s = choose_mpst_to_all!(
            s,
            CBranchesAtoC::End,
            CBranchesBtoC::End, =>
            RoleA,
            RoleB, =>
            RoleC
        );
        close_mpst(s)
    }
}

This macro is available only if MultiCrusty is built with the "macros_simple" feature.