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 with Send and/or Recv and end with End.

  • The second binary session. It must be filled with Send and/or Recv and end with End.

  • The stack of the MeshedChannels. It must be filled with a role, such as RoleA or RoleBtoAll and end with RoleEnd.

  • 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 payload from role B

Receive a payload from 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.

Choose the left branch of a binary choice and send it to B and C

Choose the right branch of a binary choice and send it to B and C

Close the current connection

Send a payload of type T to role A

Send a payload of type T to role C

Receive a payload from role A

Receive a payload from 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.

Choose the right branch of a binary choice and send it to A and C

Choose the left branch of a binary choice and send it to A and C

Close the current connection

Send a payload of type T to role A

Send a payload of type T to role B

Receive a payload from role A

Receive a payload from 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.

Choose the left branch of a binary choice and send it to A and B

Choose the right branch of a binary choice and send it to A and B

Close the current connection

Cancel the session

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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