Struct session_types::Chan [] [src]

#[must_use]
pub struct Chan<E, P>(_, _, _);

A session typed channel. P is the protocol and E is the environment, containing potential recursion targets

Methods

impl<E> Chan<E, Eps>
[src]

fn close(self)

Close a channel. Should always be used at the end of your program.

impl<E, P, A: Send + 'static> Chan<E, Send<A, P>>
[src]

fn send(self, v: A) -> Chan<E, P>

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

impl<E, P, A: Send + 'static> Chan<E, Recv<A, P>>
[src]

fn recv(self) -> (Chan<E, P>, A)

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

impl<E, P, Q> Chan<E, Choose<P, Q>>
[src]

fn sel1(self) -> Chan<E, P>

Perform an active choice, selecting protocol P.

fn sel2(self) -> Chan<E, Q>

Perform an active choice, selecting protocol Q.

impl<Z, A, B> Chan<Z, Choose<A, B>>
[src]

Convenience function. This is identical to .sel2()

fn skip(self) -> Chan<Z, B>

impl<Z, A, B, C> Chan<Z, Choose<A, Choose<B, C>>>
[src]

Convenience function. This is identical to .sel2().sel2()

fn skip2(self) -> Chan<Z, C>

impl<Z, A, B, C, D> Chan<Z, Choose<A, Choose<B, Choose<C, D>>>>
[src]

Convenience function. This is identical to .sel2().sel2().sel2()

fn skip3(self) -> Chan<Z, D>

impl<Z, A, B, C, D, E> Chan<Z, Choose<A, Choose<B, Choose<C, Choose<D, E>>>>>
[src]

Convenience function. This is identical to .sel2().sel2().sel2().sel2()

fn skip4(self) -> Chan<Z, E>

impl<Z, A, B, C, D, E, F> Chan<Z, Choose<A, Choose<B, Choose<C, Choose<D, Choose<E, F>>>>>>
[src]

Convenience function. This is identical to .sel2().sel2().sel2().sel2().sel2()

fn skip5(self) -> Chan<Z, F>

impl<Z, A, B, C, D, E, F, G> Chan<Z, Choose<A, Choose<B, Choose<C, Choose<D, Choose<E, Choose<F, G>>>>>>>
[src]

Convenience function.

fn skip6(self) -> Chan<Z, G>

impl<Z, A, B, C, D, E, F, G, H> Chan<Z, Choose<A, Choose<B, Choose<C, Choose<D, Choose<E, Choose<F, Choose<G, H>>>>>>>>
[src]

Convenience function.

fn skip7(self) -> Chan<Z, H>

impl<E, P, Q> Chan<E, Offer<P, Q>>
[src]

fn offer(self) -> Branch<Chan<E, P>, Chan<E, Q>>

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

impl<E, P> Chan<E, Rec<P>>
[src]

fn enter(self) -> Chan<(P, E), P>

Enter a recursive environment, putting the current environment on the top of the environment stack.

impl<E, P> Chan<(P, E)Var<Z>>
[src]

fn zero(self) -> Chan<(P, E), P>

Recurse to the environment on the top of the environment stack.

impl<E, P, N> Chan<(P, E)Var<S<N>>>
[src]

fn succ(self) -> Chan<E, Var<N>>

Pop the top environment from the environment stack.