1use anyhow::Result;
2
3use crate::core::output_model::OutputResult;
4
5use super::engine;
6
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
13pub enum Dsl2Mode {
14 Enabled,
16}
17
18impl Dsl2Mode {
19 #[cfg(test)]
20 pub(super) fn parse(raw: &str) -> Option<Self> {
21 match raw.trim().to_ascii_lowercase().as_str() {
22 "" | "0" | "off" | "false" | "legacy" | "1" | "on" | "true" | "enabled" | "dsl2"
23 | "ab" | "compare" | "shadow" => Some(Self::Enabled),
24 _ => None,
25 }
26 }
27}
28
29pub fn configured_mode() -> Dsl2Mode {
34 Dsl2Mode::Enabled
35}
36
37pub fn apply_output_pipeline_with_mode(
39 output: OutputResult,
40 stages: &[String],
41) -> Result<OutputResult> {
42 engine::apply_output_pipeline(output, stages)
43}