| Crates.io | optionable_codegen |
| lib.rs | optionable_codegen |
| version | 0.13.0 |
| created_at | 2025-09-30 19:53:36.781076+00 |
| updated_at | 2026-01-14 21:17:18.53412+00 |
| description | 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). |
| homepage | |
| repository | https://github.com/ngergs/optionable |
| max_upload_size | |
| id | 1861648 |
| size | 144,932 |
The relevant main crate is optionable. The docs can be found there.
This code generation proc_macro2 library serves two purposes:
#[derive(Optionable)]-macro
re-exported by optionable.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 as the proc-macro crates can't export its non-macro functions (even the proc_macro2 ones) for the usage by the codegen part.
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.