on
Procedural Macros, pt. 2: Setup
And then, there was a library.
Creating a new project that builds a library couldn’t be simpler. The above
command does just that - creates a folder named propertese
, and initializes it
with rust’s default project layout for a library (If you don’t have cargo
or
rust
installed, they can be installed with rustup).
Inside the folder propertese
, we find a Cargo.toml
with some default
options.
We need to indicate we are writing a procedural macro. Edit Cargo.toml
to add
the following snippet.
To ease development, let’s pull in the following dependencies. The linked documentation for each crate does a very good job of explaining its functionality.
That concludes our initial setup - short and sweet. We are now good to start writing code in the next installment.