Macro mpstthree::offer_http_mpst
source · macro_rules! offer_http_mpst { ($session: expr, $recv_mpst: ident, { $( $pat: pat => $result: expr, )+ }) => { ... }; }
Available on crate feature
macros_multiple
only.Expand description
Offer a choice between many different sessions wrapped in an enum
. Used with http functions
§Arguments
- The session to be used
- The recv function that will be used
- Each path, which are each variant of the enum which contains the new branches
- The block of code to process each new session
§Example
ⓘ
offer_http_mpst!(s, recv_mpst_a_from_d, {
CBranchesAtoC::End(s) => {
close_mpst_multi(s)
},
CBranchesAtoC::Video(s) => {
let (request, s) = recv_mpst_a_from_d(s)?;
let s = send_mpst_a_to_b(request + 1, s);
let (video, s) = recv_mpst_a_from_b(s)?;
let s = send_mpst_a_to_d(video + 1, s);
authenticator_recurs(s)
},
})?;
This macro is available only if MultiCrusty is built with
the "macros_multiple"
feature.