toml-scaffold
Generate commented TOML configuration scaffold files from Rust structs and values.
Features
- Preserve doc comments as TOML comments
- Preserve field order in generated TOML
- Support for common types: primitives,
Option,HashMap,Vec, nested structs andserde_json::Value
Installation
Add the following dependencies to your Cargo.toml:
[]
= { = "1", = ["derive"] }
= "1"
= "0.2"
Usage
use JsonSchema;
use Serialize;
use TomlScaffold;
/// Server configuration
Output:
# Server configuration
# Server host address
= "localhost"
# Server port
= 8080