code0_flow/flow_config/
mode.rs

1use std::str::FromStr;
2
3/// STATIC:
4/// The service will start with no Sagittarius in mind
5///
6/// DYNAMIC:
7/// The service will start with Sagittarius in mind
8#[derive(PartialEq, Eq, Debug)]
9pub enum Mode {
10    STATIC,
11    DYNAMIC,
12}
13
14impl FromStr for Mode {
15    type Err = ();
16
17    fn from_str(s: &str) -> Result<Self, Self::Err> {
18        match s.to_lowercase().as_str() {
19            "static" => Ok(Mode::STATIC),
20            "dynamic" => Ok(Mode::DYNAMIC),
21            _ => Ok(Mode::STATIC),
22        }
23    }
24}