Struct nemo::Channel [] [src]

pub struct Channel<P: Protocol, I, E: SessionType, S: SessionType> {
    pub proto: P,
    // some fields omitted
}

Channels are provided to handlers to act as a "courier" for the session type and a guard for the IO backend.

Fields

Methods

impl<I, E: SessionType, S: SessionType, P: Handler<I, E, S>> Channel<P, I, E, S>
[src]

Defer the rest of the protocol execution. Useful for returning early.

There must be a Handler implemented for the protocol state you're deferring.

impl<I: IO, E: SessionType, P: Protocol> Channel<P, I, E, End>
[src]

Close the channel. Only possible if it's in the End state.

impl<I: Transfers<T>, T, E: SessionType, S: SessionType, P: Protocol> Channel<P, I, E, Send<T, S>>
[src]

Send a T to IO.

impl<I: Transfers<T>, T, E: SessionType, S: SessionType, P: Protocol> Channel<P, I, E, Recv<T, S>>
[src]

Receive a T from IO.

impl<I, E: SessionType, S: SessionType, P: Protocol> Channel<P, I, E, Nest<S>>
[src]

Enter into a nested protocol.

impl<I, N: Peano, E: SessionType + Pop<N>, P: Protocol> Channel<P, I, E, Escape<N>>
[src]

Escape from a nested protocol.

impl<I: IO, E: SessionType, R: SessionType, P: Protocol> Channel<P, I, E, R>
[src]

Select a protocol to advance to.

impl<I: IO, E: SessionType, S: SessionType, Q: SessionType, P: Acceptor<I, E, Accept<S, Q>>> Channel<P, I, E, Accept<S, Q>>
[src]

Accept one of many protocols and advance to its handler.