Struct mpstthree::meshedchannels::MeshedChannels
source · pub struct MeshedChannels<S1, S2, R, N>{ /* private fields */ }
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, session::Session};
use mpstthree::meshedchannels::MeshedChannels;
use mpstthree::role::b::RoleB;
use mpstthree::role::c::RoleC;
use mpstthree::role::end::RoleEnd;
use mpstthree::name::a::NameA;
// 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, NameA>;
let _ = EndpointA::<i32>::new(); // Only used for example
Implementations§
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleB<R>, NameA>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleB<R>, NameA>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameA>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameA>
Send a payload of type T to role B
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleC<R>, NameA>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleC<R>, NameA>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameA>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameA>
Send a payload of type T to role C
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleB<R>, NameA>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleB<R>, NameA>
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleC<R>, NameA>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleC<R>, NameA>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameA>, End, RoleAlltoB<RoleEnd, RoleEnd>, NameA>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameA>, End, RoleAlltoB<RoleEnd, RoleEnd>, NameA>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameA>, RoleAlltoC<RoleEnd, RoleEnd>, NameA>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameA>, RoleAlltoC<RoleEnd, RoleEnd>, NameA>
source§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, NameB>, MeshedChannels<S4, <S1 as Session>::Dual, R1, NameB>>, End>, Send<Either<MeshedChannels<S3, S0, R2, NameC>, MeshedChannels<S5, S1, R3, NameC>>, End>, RoleAtoAll<R4, R5>, NameA>
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, NameB>, MeshedChannels<S4, <S1 as Session>::Dual, R1, NameB>>, End>, Send<Either<MeshedChannels<S3, S0, R2, NameC>, MeshedChannels<S5, S1, R3, NameC>>, End>, RoleAtoAll<R4, R5>, NameA>
sourcepub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameA>
pub fn choose_left( self ) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameA>
Choose the left branch of a binary choice and send it to B and C
sourcepub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameA>
pub fn choose_right( self ) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameA>
Choose the right branch of a binary choice and send it to B and C
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleA<R>, NameB>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleA<R>, NameB>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameB>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameB>
Send a payload of type T to role A
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleC<R>, NameB>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleC<R>, NameB>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameB>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameB>
Send a payload of type T to role C
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleA<R>, NameB>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleA<R>, NameB>
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleC<R>, NameB>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleC<R>, NameB>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameB>, End, RoleAlltoA<RoleEnd, RoleEnd>, NameB>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameB>, End, RoleAlltoA<RoleEnd, RoleEnd>, NameB>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameB>, RoleAlltoC<RoleEnd, RoleEnd>, NameB>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameB>, RoleAlltoC<RoleEnd, RoleEnd>, NameB>
source§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, NameA>, MeshedChannels<S4, <S1 as Session>::Dual, R1, NameA>>, End>, Send<Either<MeshedChannels<S0, S3, R2, NameC>, MeshedChannels<S1, S5, R3, NameC>>, End>, RoleBtoAll<R4, R5>, NameB>
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, NameA>, MeshedChannels<S4, <S1 as Session>::Dual, R1, NameA>>, End>, Send<Either<MeshedChannels<S0, S3, R2, NameC>, MeshedChannels<S1, S5, R3, NameC>>, End>, RoleBtoAll<R4, R5>, NameB>
sourcepub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameB>
pub fn choose_left( self ) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameB>
Choose the right branch of a binary choice and send it to A and C
sourcepub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameB>
pub fn choose_right( self ) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameB>
Choose the left branch of a binary choice and send it to A and C
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleA<R>, NameC>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Send<T, S1>, S2, RoleA<R>, NameC>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameC>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameC>
Send a payload of type T to role A
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleB<R>, NameC>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Send<T, S2>, RoleB<R>, NameC>
sourcepub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameC>
pub fn send(self, payload: T) -> MeshedChannels<S1, S2, R, NameC>
Send a payload of type T to role B
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleA<R>, NameC>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<Recv<T, S1>, S2, RoleA<R>, NameC>
source§impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleB<R>, NameC>
impl<S1: Session, S2: Session, R: Role, T: Send> MeshedChannels<S1, Recv<T, S2>, RoleB<R>, NameC>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameC>, End, RoleAlltoA<RoleEnd, RoleEnd>, NameC>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<OfferMpst<S1, S2, S3, S4, R1, R2, NameC>, End, RoleAlltoA<RoleEnd, RoleEnd>, NameC>
source§impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameC>, RoleAlltoB<RoleEnd, RoleEnd>, NameC>
impl<'a, S1: Session, S2: Session, S3: Session, S4: Session, R1: Role, R2: Role> MeshedChannels<End, OfferMpst<S1, S2, S3, S4, R1, R2, NameC>, RoleAlltoB<RoleEnd, RoleEnd>, NameC>
source§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, NameA>, MeshedChannels<<S1 as Session>::Dual, S4, R1, NameA>>, End>, Send<Either<MeshedChannels<S0, S3, R2, NameB>, MeshedChannels<S1, S5, R3, NameB>>, End>, RoleCtoAll<R4, R5>, NameC>
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, NameA>, MeshedChannels<<S1 as Session>::Dual, S4, R1, NameA>>, End>, Send<Either<MeshedChannels<S0, S3, R2, NameB>, MeshedChannels<S1, S5, R3, NameB>>, End>, RoleCtoAll<R4, R5>, NameC>
sourcepub fn choose_left(
self
) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameC>
pub fn choose_left( self ) -> MeshedChannels<<S2 as Session>::Dual, <S3 as Session>::Dual, R4, NameC>
Choose the left branch of a binary choice and send it to A and B
sourcepub fn choose_right(
self
) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameC>
pub fn choose_right( self ) -> MeshedChannels<<S4 as Session>::Dual, <S5 as Session>::Dual, R5, NameC>
Choose the right branch of a binary choice and send it to A and B
Trait Implementations§
source§impl<S1, S2, R, N> Debug for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> Debug for MeshedChannels<S1, S2, R, N>
Auto Trait Implementations§
impl<S1, S2, R, N> Freeze for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> RefUnwindSafe for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> Send for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> Sync for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> Unpin for MeshedChannels<S1, S2, R, N>
impl<S1, S2, R, N> UnwindSafe for MeshedChannels<S1, S2, R, N>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more