sirius_bindings/parameters/
zodiac.rs

1use crate::traits::{Enablable, IntoDefault, NamedParametersSet};
2
3/// The possible zodiac settings
4#[derive(Debug, Clone, Copy, PartialEq)]
5pub enum ZodiacV5 {
6    /// If the zodiac is enabled
7    Enabled,
8
9    /// The version of the zodiac
10    Version,
11
12    /// The help for the zodiac
13    Help,
14}
15
16impl ToString for ZodiacV5 {
17    fn to_string(&self) -> String {
18        match self {
19            ZodiacV5::Enabled => Self::parameter_set_name().to_string(),
20            ZodiacV5::Help => "--help".to_string(),
21            ZodiacV5::Version => "--version".to_string(),
22        }
23    }
24}
25
26impl IntoDefault for ZodiacV5 {
27    fn into_default(self) -> Self {
28        match self {
29            ZodiacV5::Enabled => ZodiacV5::Enabled,
30            ZodiacV5::Help => ZodiacV5::Help,
31            ZodiacV5::Version => ZodiacV5::Version,
32        }
33    }
34}
35
36impl Enablable for ZodiacV5 {
37    fn is_enabler(&self) -> bool {
38        matches!(self, ZodiacV5::Enabled)
39    }
40
41    fn enabler() -> Self {
42        ZodiacV5::Enabled
43    }
44}
45
46impl NamedParametersSet for ZodiacV5 {
47    fn parameter_set_name() -> &'static str {
48        "zodiac"
49    }
50}