pub enum Target {
Done,
Recv(Type, Rc<Spanned<Target>>),
Send(Type, Rc<Spanned<Target>>),
Choose(Vec<Spanned<Target>>),
Offer(Vec<Spanned<Target>>),
Loop(Rc<Spanned<Target>>),
Continue(usize),
Split {
tx_only: Rc<Spanned<Target>>,
rx_only: Rc<Spanned<Target>>,
cont: Rc<Spanned<Target>>,
},
Call(Rc<Spanned<Target>>, Rc<Spanned<Target>>),
Then(Rc<Spanned<Target>>, Rc<Spanned<Target>>),
Type(Type),
}
Expand description
The target language of the macro: the type level language of session types in Dialectic.
This is a one-to-one mapping to the literal syntax you would write without using the Session!
macro. The only constructors which don’t correspond directly to constructs with Session
implementations are Target::Then
, which translates to a type-level function invocation to
concatenate two session types, and Target::Type
, which translates to an embedding of some
arbitrary session type by name (i.e. defined elsewhere as a synonym).
Variants§
Done
Session type: Done
.
Recv(Type, Rc<Spanned<Target>>)
Session type: Recv<T, P>
.
Send(Type, Rc<Spanned<Target>>)
Session type: Send<T, P>
.
Choose(Vec<Spanned<Target>>)
Session type: Choose<(P, ...)>
.
Offer(Vec<Spanned<Target>>)
Session type: Offer<(P, ...)>
.
Loop(Rc<Spanned<Target>>)
Session type: Loop<...>
.
Continue(usize)
Session type: Continue<N>
.
Split
Session type: Split<P, Q, R>
.
Fields
Call(Rc<Spanned<Target>>, Rc<Spanned<Target>>)
Session type: Call<P, Q>
.
Then(Rc<Spanned<Target>>, Rc<Spanned<Target>>)
Session type: <P as Then<Q>>::Combined
.
Type(Type)
Some arbitrary session type referenced by name.