pub struct Protocol<P: 'static, S = Bincode> { /* private fields */ }
Expand description

A Protocol is a specific type of Process.

It uses session types to check during compile time that all messages exchanged between two processes are in the correct order and of the correct type.

Implementations

Send a value of type A over the session. Returns a session with protocol P.

Receives a value of type A from the session. Returns a tuple containing the resulting session and the received value.

A task is a special case of a protocol spawned with the spawn!(@task ...) macro. It only returns one value.

A task is a special case of a protocol spawned with the spawn!(@task ...) macro. It only returns one value.

Perform an active choice, selecting protocol P.

Perform an active choice, selecting protocol Q.

Passive choice. This allows the other end of the session to select one of two options for continuing the protocol: either P or Q.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.