[][src]Module dialectic::backend

Transport backends for Chan, and the traits they implement in order to be used as such.

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, Choice<N>, Val>, and the receiving channel Rx must implement Receive<Choice<N>>, for all N. For more information, see Choice.

Re-exports

pub use call_by::*;

Modules

mpscmpsc

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.

serdeserde

A family of backend implementations using the serde crate to transport Serialize and Deserialize values by reference across any AsyncRead and AsyncWrite transports.

Structs

Choice

A Choice represents a selection between several protocols offered by offer!.

OutOfBoundsChoiceError

When attempting to construct a Choice<N> via try_into or try_from, this error is thrown when the choice exceeds the type-level strict upper bound N.

Traits

Receive

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

Transmit

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