Crate fastpasta_toml_macro
source ·Expand description
Description
Convenience crate with a trait definition for use with the procedural derive macro fastpasta_toml_macro_derive
.
Example
use fastpasta_toml_macro::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.