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