| gen.rs |
Generates output for the `implement` proc macro.
Each function in this module focuses on generating one thing, or one kind of thing.
Each takes `ImplementInputs` as its input. `gen_all` calls all of the `gen_*` functions
and merges them into the final list of output items.
We use `parse_quote` so that we can verify that a given function generates a well-formed AST
item, within the narrowest possible scope. This allows us to detect errors more quickly during
development. If the input to `parse_quote` cannot be parsed, then the macro will panic and
the panic will point to the specific `parse_quote` call, rather than the entire output of the
`implement` proc macro being unparsable. This greatly aids in development. |
23607 |
| lib.rs |
Implement COM interfaces for Rust types.
Take a look at [macro@implement] for an example.
Learn more about Rust for Windows here: <https://github.com/microsoft/windows-rs> |
12682 |
| tests.rs |
These tests are just a way to quickly run the `#[implement]` macro and see its output.
They don't check the output in any way.
This exists because of some difficulties of running `cargo expand` against the `#[implement]`
macro. It's also just really convenient. You can see the output by using `--nocapture` and
you'll probably want to restrict the output to a single thread:
```text
cargo test -p windows-implement --lib -- --nocapture --test-threads=1
``` |
3098 |