Macro mpstthree::choose_mpst_multi_to_all
source · macro_rules! choose_mpst_multi_to_all { ( $session: expr, $( $label: path , )+ => $sender: ident, $meshedchannels_name: ident, $exclusion: literal ) => { ... }; }
Available on crate feature
macros_multiple
only.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, =>
NameD,
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, =>
NameD,
MeshedChannels,
3
);
close_mpst_multi(s)
}
}
This macro is available only if MultiCrusty is built with
the "macros_multiple"
feature.