Macros§
- The
Session!
macro compiles a small domain-specific language for describing session types into the types themselves. It should be invoked in type position. - Internal implementation detail: This proc macro generates trait implementations of
ToUnary
andToConstant
which convert type-level constants into unary representation, and vice versa. It will generate up to the maximum number specified as the argument. - Internal implementation detail: This proc macro generates implementations of
Tuple
andAsList
for tuples up to the arity passed in as the argument. - The
offer!
macro offers a set of different protocols, allowing the other side of the channel to choose with which one to proceed.
Attribute Macros§
- In situations where the transmitting backend for a channel is generic, explicitly writing down all the trait bounds necessary to implement a protocol for that parameterized backend can be a lot of boilerplate. The
Receiver
attribute macro abbreviates these bounds by modifying thewhere
clause of the item to which it is attached. - In situations where the transmitting backend for a channel is generic, explicitly writing down all the trait bounds necessary to implement a protocol for that parameterized backend can be a lot of boilerplate. The
Transmitter
attribute macro abbreviates these bounds by modifying thewhere
clause of the item to which it is attached.