Git repository to accompany medium post:
The repository contains the following directory (binary crates):
a_naive
contains the source code defining theTriangle
andSquare
types alongside a straightforward implementation of a draw function;c_trait
contains the implementation of thedraw
functionality using traits and generics;d_declarative_macro
contains the implementation of thedraw
functionality using a declarative macro;e_procedural_macro
contains the implementaiton of thedraw
functionality using a procedural macro - located ine2_derive_draw
.
Run each example using the following commands:
cargo run --bin a_naive # For the code in the `a_naive` directory
cargo run --bin c_trait # For the trait/generic based example
# etc