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()
impl<Z, A, B, C> Chan<Z, Choose<A, Choose<B, C>>>
[src]
Convenience function. This is identical to .sel2().sel2()
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()
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()
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()
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.
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.
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.