[][src]Module dialectic::backend

A Chan<Tx, Rx, P, E> is parameterized by its transmitting channel Tx and its receiving channel Rx. In order to use a Chan to run a session, these underlying channels must implement the traits Transmit and Receive for at least the types used in any given session (and in the case of Transmit, for the particular calling conventions used to pass those types to Chan::send).

Additionally, in order to support offer! and choose, the sending channel Tx must implement Transmit<'static, u8, Val>, and the receiving channel Rx must implement Receive<u8>.

Modules

mpsc

A backend implementation using tokio::sync::mpsc channels carrying boxed values Box<dyn Any + Send>, which are downcast to their true type (inferred from the session type) on the other end of the channel.

Structs

Mut

Taking a T by Mutable reference means taking &'a mut T as input to or output from a function.

Ref

Taking a T by Reference means taking &'a T as input to or output from a function.

Val

Taking a T by Value means taking a T as input to or output from a function.

Traits

CallBy

To get the type of T via calling convention Convention, write <T as CallBy<'a, Convention>>::Type.

CallingConvention

There are three fundamental ways to pass a T as input or return a T as output: by Value, by shared immutable Reference, and by unique Mutable reference.

Receive

If something is Receive<T>, we can use it to Receive::recv a message of type T.

Transmit

If something is Transmit<'a, T, Convention>, we can use it to Transmit::send a message of type T by Val, Ref, or Mut, depending on the calling convention specified.