espforge_lib/parse/processor.rs
1use anyhow::Result;
2use espforge_configuration::EspforgeConfiguration;
3use serde_yaml_ng::Value;
4
5pub trait SectionProcessor {
6 fn section_key(&self) -> &'static str;
7 fn priority(&self) -> u32 {
8 50
9 }
10 fn process(&self, content: &Value, model: &mut EspforgeConfiguration) -> Result<()>;
11}
12
13pub struct ProcessorRegistration {
14 pub factory: fn() -> Box<dyn SectionProcessor>,
15}
16
17inventory::collect!(ProcessorRegistration);