1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! This module contains the macros
//! for creating choose functions for any number
//! of participants for timed protocols.
//!
//! *This module is available only if MultiCrusty is built with
//! the `"baking_atmp"` feature.*
/// Choose among different sessions that are provided.
///
/// # Arguments
///
/// * The session to be used
/// * The Hashmap with all the clocks to be used. It need to have a `&mut`.
/// * 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.
///
/// ```ignore
/// match xs.pop() {
/// Option::Some(_) => {
/// let s = choose_atmp_mpst_multi_to_all!(
/// s,
/// &mut all_clocks,
/// CBranchesAtoC::Video,
/// CBranchesBtoC::Video, =>
/// NameD,
/// MeshedChannels,
/// 3
/// );
/// let s = s.send(all_clocks, 1)?;
/// let (_, s) = s.recv(all_clocks)?;
/// client_recurs(s, xs, index + 1)
/// }
/// Option::None => {
/// let s = choose_atmp_mpst_multi_to_all!(
/// s,
/// &mut all_clocks,
/// CBranchesAtoC::End,
/// CBranchesBtoC::End, =>
/// NameD,
/// MeshedChannels,
/// 3
/// );
/// s.close()
/// }
/// }
/// ```
///
/// *This macro is available only if MultiCrusty is built with
/// the `"baking_atmp"` feature.*