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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! This module contains the macros
//! for creating close functions for any number
//! of participants.
//!
//! *This module is available only if MultiCrusty is built with
//! the `"macros_multiple"` feature.*

/// Create the close function to be used with more than 3
/// participants.
///
/// # Arguments
///
/// * The name of the new *close* function
/// * The name of the *MeshedChannels* type that will be used
/// * The number of participants (all together)
///
/// # Example
///
/// ```
/// use mpstthree::{close_mpst, create_meshedchannels};
///
/// create_meshedchannels!(MeshedChannels, 3);
///
/// close_mpst!(close_mpst_multi, MeshedChannels, 3);
/// ```
///
/// *This macro is available only if MultiCrusty is built with
/// the `"macros_multiple"` feature.*
#[macro_export]
#[cfg_attr(doc_cfg, doc(cfg(feature = "macros_multiple")))]
macro_rules! close_mpst {
    ($func_name:ident, $meshedchannels_name:ident, $n_sessions:literal) => {
        mpst_seq::close_mpst!($func_name, $meshedchannels_name, $n_sessions);
    };
}

/// Create the close function to be used with more than 3
/// participants.
///
/// # Arguments
///
/// * The name of the new *close* function
/// * The name of the *MeshedChannels* type that will be used
/// * The number of participants (all together)
///
/// # Example
///
/// ```
/// use mpstthree::{close_mpst, create_meshedchannels};
///
/// create_meshedchannels!(MeshedChannels, 3);
///
/// close_mpst!(close_mpst_multi, MeshedChannels, 3);
/// ```
///
/// *This macro is available only if MultiCrusty is built with
/// the `"macros_multiple"` feature.*
#[macro_export]
#[cfg_attr(doc_cfg, doc(cfg(feature = "macros_multiple")))]
macro_rules! close_mpst_check_cancel {
    ($func_name:ident, $meshedchannels_name:ident, $n_sessions:literal) => {
        mpst_seq::close_mpst_check_cancel!($func_name, $meshedchannels_name, $n_sessions);
    };
}

/// Create the close function to be used with more than 3
/// participants.
/// It is used for checking the send sides upon closing.
///
/// # Arguments
///
/// * The name of the new *close* function
/// * The name of the *MeshedChannels* type that will be used
/// * The number of participants (all together)
///
/// # Example
///
/// ```
/// use mpstthree::{close_mpst_cancel, create_meshedchannels};
///
/// create_meshedchannels!(MeshedChannels, 3);
///
/// close_mpst_cancel!(close_mpst_multi, MeshedChannels, 3);
/// ```
///
/// *This macro is available only if MultiCrusty is built with
/// the `"macros_multiple"` feature.*
#[macro_export]
#[cfg_attr(doc_cfg, doc(cfg(feature = "macros_multiple")))]
macro_rules! close_mpst_cancel {
    ($func_name:ident, $meshedchannels_name:ident, $n_sessions:literal) => {
        mpst_seq::close_mpst_cancel!($func_name, $meshedchannels_name, $n_sessions);
    };
}