use alloc::string::String;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TagResult {
Processed,
Ignored,
Failed(String),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SectionResult {
Processed,
Ignored,
Failed(String),
}
pub trait TagHandler: Send + Sync {
fn name(&self) -> &'static str;
fn process(&self, args: &str) -> TagResult;
fn validate(&self, args: &str) -> bool {
!args.is_empty()
}
}
pub trait SectionProcessor: Send + Sync {
fn name(&self) -> &'static str;
fn process(&self, header: &str, lines: &[&str]) -> SectionResult;
fn validate(&self, header: &str, lines: &[&str]) -> bool {
!header.is_empty() && !lines.is_empty()
}
}