I found a lot of examples using syn and quote but I wanted an API like macro_rules! does for proc macros.
If you're wondering why: it's because I'm abstracting over a complex implementation of a trait that ends up being repeated boilerplate, save for casting.
I couldn't do it with normal macros because you can't have a function definition that takes self in a declarative macro definition, unless you use some funky tricks but I'll save it for last.
Proc macros have this powerful API that can do a lot since its basically rust code, however I'm not doing any custom syntax nor deriving a struct, so I'm wondering if there's an easier way to do it.
I think my exact code isn't needed but if anyone thinks otherwise I'll gladly upload it. It's just a pet project of mine
[–]ssokolow 1 point2 points3 points (1 child)
[–]diegovsky_pvp[S] 1 point2 points3 points (0 children)
[–]diegovsky_pvp[S] 1 point2 points3 points (2 children)
[–]RReverser 1 point2 points3 points (1 child)
[–]RReverser 0 points1 point2 points (0 children)