2 releases
0.1.1 | Jul 15, 2023 |
---|---|
0.1.0 | Jul 7, 2023 |
#3 in #toml-macro
32 downloads per month
6KB
DEPRECATED - MOVED TO https://crates.io/crates/descriptive_toml_derive
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();
assert_eq!(
toml_string,
"\
# Number of CRU Data Packets expected in the data
# Example: 20, 500532
#cdps = None [ u32 ] # (Uncomment and set to enable this check)
"
lib.rs
:
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)
Dependencies
~280–730KB
~17K SLoC