Crate descriptive_toml_derive
source ·Expand description
Description
Convenience crate with a trait definition for use with the procedural derive macro descriptive_toml_derive_macro
.
Example
use descriptive_toml_derive::TomlConfig;
#[derive(TomlConfig, Default)]
pub struct CustomChecks {
#[description = "Number of CRU Data Packets expected in the data"]
#[example = "20, 500532"]
cdps: Option<u32>,
}
let toml_string = CustomChecks::default().to_string_pretty_toml();
println!({}, toml_string);
Output:
# Number of CRU Data Packets expected in the data
# Example: 20, 500532
#cdps = None [ u32 ] # (Uncomment and set to enable)
Traits
- This trait is derived through the TomlConfig derive macro.