optionable_codegen 0.7.4

proc_macro2 functions for the derive macro and codegen implementations in the `optionable_derive` crate to derive nested structs/enums with all subfields being optional (e.g. for patches or Kubernetes server side apply).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# optionable_codegen

The relevant main crate is [optionable](https://crates.io/crates/optionable). The docs can be found there.

## Purpose
This code generation `proc_macro2` library serves two purposes:
- Used by [optionable_derive]https://crates.io/crates/optionable_derive to implement the `#[derive(Optionable)]`-macro 
re-exported by [optionable]https://crates.io/crates/optionable_derive.
- Used by the [bin/codegen.rs]bin/codegen.rs crate to support generating `Optionable`-implementations for external packages.
Due to the orphan rule  the generated code has to be added to the `Optionable`-package (PRs welcome).

It has to be a separate crate from [optionable_derive](https://crates.io/crates/optionable_derive) as the proc-macro crates
can't export its non-macro functions (even the proc_macro2 ones) for the usage by the codegen part.

## Limitations
The codegen logic is at the moment very simple and can only handle very minimalistic input rust types
that basically only contain `mod`, `struct` and `enum`. Additional declarations are not an issue if it is ok
to simply ignore them.