spec
A proof-of-concept crate of adding "function specialization" to rust. It supports regular parameters, wild card (_) parameters, and tuple, tuple struct and struct destructuring.
The crate allows defining a function and its specialized cases, using rusts match statements to create a "specialized function". This has the neat side effect of getting exhaustive pattern enforcement by rust itself while staying light weight.
// This definition:
spec!
// Turns into this:
Destructured tuples and structs are put into a tuple in the match case!
spec!
spec!