Crates.io | fastpasta_toml_macro |
lib.rs | fastpasta_toml_macro |
version | 0.1.1 |
source | src |
created_at | 2023-07-07 08:49:56.817665 |
updated_at | 2023-07-15 09:08:25.676202 |
description | DEPRECATED. Development continues at: https://crates.io/crates/descriptive_toml_derive. Convenience crate with a trait definition for use with the procedural derive macro fastpasta_toml_macro_derive. |
homepage | |
repository | https://gitlab.cern.ch/mkonig/fastpasta |
max_upload_size | |
id | 910577 |
size | 5,318 |
Convenience crate with a trait definition for use with the procedural derive macro fastpasta_toml_macro_derive
.
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)
"