Macro mpstthree::choose_mpst_to_all [−][src]
macro_rules! choose_mpst_to_all { ($session : expr, $($label : path,) + => $($receiver : ident,) + => $sender : ident) => { ... }; }
Expand description
Choose among two different sessions.
Must be used with mpstthree::meshedchannels::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) } }