"Hello rustaceans, I'm trying..." <- > <@haobogu:matrix.org> Hello rustaceans, I'm trying to write a lib crate for embedded, I have a question about configuration. The following is what I want to do: > > - use .toml as the configuration file, library users could customize their own config when using the library > - provide lib users a `build.rs` to load user's .toml file and generate consts of all configurations at compile-time > - all config structs are defined in library with defaults, only defined config are loaded from toml > > I tried `const-gen` crate, but it cannot generate structs from library. `proc-macro` seems not feasible for this case as well. Is there any other solutions for it? I wrote a crate for this: https://github.com/jamesmunns/toml-cfg It's a little hacky, and this isn't generally how most Rust works, vs C where you'd use a lot of `#define`s to do this.