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
//! This module contains the macros for
//! creating the different structures and
//! associated functions for any number
//! of participants in timed protocols to simplify send/recv.
/// Create new SessionMST structures, new roles and the baking environment,
/// with `send` functions that can fail, for timed protocols.
/// Also create the macros needed for choosing branches.
/// Each macro is linked to a role X and are called as followed:
/// choose_mpst_x_to_all!(
/// s, # the current session
/// enum_1::variant_1, # the first branch for the first passive role
/// enum_2::variant_2, # the first branch for the second passive role
/// ...
/// enum_n::variant_n, # the first branch for the n-th passive role
/// )
/// This macro creates the related `fork_mpst` function.
///
/// # Arguments
///
/// * Name of the new SessionMST
/// * Names of the new roles. They are called as RoleX where X is the name provided.
///
/// # Basic example
///
/// ```
/// use mpstthree::generate_atmp;
///
/// generate_atmp!(MeshedChannels, A, B, C);
/// ```