Function mpstthree::functionmpst::offer::offer_mpst_session_to_a_from_b
source · pub fn offer_mpst_session_to_a_from_b<'a, S1, S2, S3, S4, S5, F, G, R1, R2, U>(
s: MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameA>, S5, RoleAlltoB<RoleEnd, RoleEnd>, NameA>,
f: F,
g: G
) -> Result<U, Box<dyn Error + 'a>>
Expand description
Offer a choice to A from B (on its session field related
to B) between two MeshedChannels
,
MeshedChannels<S1, S2, R1, N1>
and MeshedChannels<S3, S4, R2, N2>
.
§Example
// Please check the tests usecase
ⓘ
offer_mpst_session_to_a_from_b(
s,
|s: EndpointARecv<i32>| {
let (request, s) = recv_mpst_a_from_b(s)?;
close_mpst(s)
},
|s: EndpointAEnd| {
close_mpst(s)
},
)