miniconf
miniconf copied to clipboard
Expose key docstring metadata
trafficstars
As part of the derive macro, it would be useful to use a Key to look up the docstring related to the entry. For example:
#[derive(miniconf::Tree)]
struct Settings {
/// The selected sampling rate in Hz.
sample_rate: f32,
}
assert_eq!(Settings::get_metadata("/sample_rate", "The selected sampling rate in Hz."),
This would allow the code comments to be exposed as helpful information about the settings tree
roughly like this: https://github.com/cyqsimon/documented/blob/master/documented-derive/src/lib.rs
https://git.mkaenner.de/max/macroconf/src/commit/35afc0f4845ad41e902ad0ddbef57c202e11073b/src/lib.rs#L280