Struct mpstthree::meshedchannels::MeshedChannels [−][src]
pub struct MeshedChannels<S1, S2, R, N> where
S1: Session,
S2: Session,
R: Role,
N: Role, { /* fields omitted */ }
Expand description
The structure which encapsulates two binary session types, a stack and a name.
Arguments
-
The first binary
session
. It must be filled withSend
and/orRecv
and end withEnd
. -
The second binary
session
. It must be filled withSend
and/orRecv
and end withEnd
. -
The stack of the MeshedChannels. It must be filled with a role, such as
RoleA
orRoleBtoAll
and end withRoleEnd
. -
The name of the role of the MeshedChannels. It must be one among: RoleA
, RoleB or RoleC .
Example
use mpstthree::binary::struct_trait::{end::End, recv::Recv, send::Send};
use mpstthree::meshedchannels::MeshedChannels;
use mpstthree::binary::struct_trait::session::Session; // Only used for example
use mpstthree::role::a::RoleA;
use mpstthree::role::b::RoleB;
use mpstthree::role::c::RoleC;
use mpstthree::role::end::RoleEnd;
// Creating the binary sessions
type AtoB<N> = Send<N, End>;
type AtoC<N> = Recv<N, End>;
// Stacks
type StackA = RoleB<RoleC<RoleEnd>>;
// Creating the MP sessions
type EndpointA<N> = MeshedChannels<AtoB<N>, AtoC<N>, StackA, RoleA<RoleEnd>>;
let _ = EndpointA::<i32>::new(); // Only used for example
Implementations
Send a payload of type T to role B
Send a payload of type T to role C
Receive a binary choice from role B. Be careful: the left and right stacks must be the same.
Receive a binary choice from role C. Be careful: the left and right stacks must be the same.
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<S2, <S0 as Session>::Dual, R0, RoleB<RoleEnd>>, MeshedChannels<S4, <S1 as Session>::Dual, R1, RoleB<RoleEnd>>>, End>, Send<Either<MeshedChannels<S3, S0, R2, RoleC<RoleEnd>>, MeshedChannels<S5, S1, R3, RoleC<RoleEnd>>>, End>, RoleAtoAll<R4, R5>, RoleA<RoleEnd>>
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<S2, <S0 as Session>::Dual, R0, RoleB<RoleEnd>>, MeshedChannels<S4, <S1 as Session>::Dual, R1, RoleB<RoleEnd>>>, End>, Send<Either<MeshedChannels<S3, S0, R2, RoleC<RoleEnd>>, MeshedChannels<S5, S1, R3, RoleC<RoleEnd>>>, End>, RoleAtoAll<R4, R5>, RoleA<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleA<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleA<RoleEnd>>
Choose the left branch of a binary choice and send it to B and C
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleA<RoleEnd>>
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleA<RoleEnd>>
Choose the right branch of a binary choice and send it to B and C
Send a payload of type T to role A
Send a payload of type T to role C
Receive a binary choice from role A. Be careful: the left and right stacks must be the same.
Receive a binary choice from role C. Be careful: the left and right stacks must be the same.
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<S2, <S0 as Session>::Dual, R0, RoleA<RoleEnd>>, MeshedChannels<S4, <S1 as Session>::Dual, R1, RoleA<RoleEnd>>>, End>, Send<Either<MeshedChannels<S0, S3, R2, RoleC<RoleEnd>>, MeshedChannels<S1, S5, R3, RoleC<RoleEnd>>>, End>, RoleBtoAll<R4, R5>, RoleB<RoleEnd>>
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<S2, <S0 as Session>::Dual, R0, RoleA<RoleEnd>>, MeshedChannels<S4, <S1 as Session>::Dual, R1, RoleA<RoleEnd>>>, End>, Send<Either<MeshedChannels<S0, S3, R2, RoleC<RoleEnd>>, MeshedChannels<S1, S5, R3, RoleC<RoleEnd>>>, End>, RoleBtoAll<R4, R5>, RoleB<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleB<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleB<RoleEnd>>
Choose the right branch of a binary choice and send it to A and C
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleB<RoleEnd>>
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleB<RoleEnd>>
Choose the left branch of a binary choice and send it to A and C
Send a payload of type T to role A
Send a payload of type T to role B
Receive a binary choice from role A. Be careful: the left and right stacks must be the same.
Receive a binary choice from role B. Be careful: the left and right stacks must be the same.
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<<S0 as Session>::Dual, S2, R0, RoleA<RoleEnd>>, MeshedChannels<<S1 as Session>::Dual, S4, R1, RoleA<RoleEnd>>>, End>, Send<Either<MeshedChannels<S0, S3, R2, RoleB<RoleEnd>>, MeshedChannels<S1, S5, R3, RoleB<RoleEnd>>>, End>, RoleCtoAll<R4, R5>, RoleC<RoleEnd>>
impl<S0: Session, S1: Session, S2: Session, S3: Session, S4: Session, S5: Session, R0: Role, R1: Role, R2: Role, R3: Role, R4: Role, R5: Role> MeshedChannels<Send<Either<MeshedChannels<<S0 as Session>::Dual, S2, R0, RoleA<RoleEnd>>, MeshedChannels<<S1 as Session>::Dual, S4, R1, RoleA<RoleEnd>>>, End>, Send<Either<MeshedChannels<S0, S3, R2, RoleB<RoleEnd>>, MeshedChannels<S1, S5, R3, RoleB<RoleEnd>>>, End>, RoleCtoAll<R4, R5>, RoleC<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleC<RoleEnd>>
pub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, RoleC<RoleEnd>>
Choose the left branch of a binary choice and send it to A and B
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleC<RoleEnd>>
pub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, RoleC<RoleEnd>>
Choose the right branch of a binary choice and send it to A and B
Trait Implementations
Auto Trait Implementations
impl<S1, S2, R, N> RefUnwindSafe for MeshedChannels<S1, S2, R, N> where
N: RefUnwindSafe,
R: RefUnwindSafe,
S1: RefUnwindSafe,
S2: RefUnwindSafe,
impl<S1, S2, R, N> Send for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> Sync for MeshedChannels<S1, S2, R, N> where
N: Sync,
R: Sync,
S1: Sync,
S2: Sync,
impl<S1, S2, R, N> Unpin for MeshedChannels<S1, S2, R, N> where
N: Unpin,
R: Unpin,
S1: Unpin,
S2: Unpin,
impl<S1, S2, R, N> UnwindSafe for MeshedChannels<S1, S2, R, N> where
N: UnwindSafe,
R: UnwindSafe,
S1: UnwindSafe,
S2: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more