postfix_log_parser/components/
virtual_parser.rs

1//! 虚拟投递(virtual)组件解析器
2
3use crate::components::ComponentParser;
4use crate::error::ParseError;
5use crate::events::ComponentEvent;
6
7/// 虚拟投递解析器
8pub struct VirtualParser;
9
10impl VirtualParser {
11    pub fn new() -> Self {
12        Self
13    }
14}
15
16impl ComponentParser for VirtualParser {
17    fn parse(&self, _message: &str) -> Result<ComponentEvent, ParseError> {
18        // TODO: 实现virtual具体解析逻辑
19        Err(ParseError::ComponentParseError {
20            component: "virtual".to_string(),
21            reason: "virtual解析器尚未实现".to_string(),
22        })
23    }
24
25    fn component_name(&self) -> &'static str {
26        "virtual"
27    }
28}
29
30impl Default for VirtualParser {
31    fn default() -> Self {
32        Self::new()
33    }
34}