Expand description
Crate providing the essential functionality for the compile time
generation of the
rusty_junctions
crate to an arbitrary pattern arity.
The intention of this crate is to be called from within the root of
the
rusty_junctions
crate library in order to generate all of the essential components:
-
The
PartialPatternandTerminalPartialPatternpatternsthat leverage the compiler to provide the type safety guarantees provided to the clients at compile time, preventing a number of difficult to debug runtime issues. -
When applying the
then_domethod to aPartialPatternor aTerminalPartialPatternwe are required to pass in a closure. Thefunction_transformare used to transform the types of the closure to acceptMessageas the arguments. -
The type of the transformed closures also depend on the arity of the associated
pattern, so we are required to generate this programmatically. This is done internally using thefunction_typesMacro. -
Finally the
JoinPatternderive macro which is used to derive the implementation of theJoinPatterntrait from thePartialPatternorTerminalPartialPattern.
See the function level documentation for further details.
Macros§
- library_
generate - Generate the
rusty_junctionscrate to an arbitrary pattern arity.
Derive Macros§
- Join
Pattern - Derive the implementation of the
JoinPatterntrait from thePartialPatternorTerminalPartialPattern. - Partial
Pattern - Derive the implementation of the a Partial
patternfrom a givenstruct. - Terminal
Partial Pattern - Derive the implementation of the a Terminal
patternfrom a givenstruct.