1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use super::EnumTrait;
use std::str::FromStr;
#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)]
pub enum HorizontalAlignmentValues {
    Center,
    CenterContinuous,
    Distributed,
    Fill,
    General,
    Justify,
    Left,
    Right,
}
impl Default for HorizontalAlignmentValues {
    fn default() -> Self {
        Self::General
    }
}
impl EnumTrait for HorizontalAlignmentValues {
    fn get_value_string(&self) -> &str {
        match &self {
            Self::Center => "center",
            Self::CenterContinuous => "centerContinuous",
            Self::Distributed => "distributed",
            Self::Fill => "fill",
            Self::General => "general",
            Self::Justify => "justify",
            Self::Left => "left",
            Self::Right => "right",
        }
    }
}
impl FromStr for HorizontalAlignmentValues {
    type Err = ();
    fn from_str(input: &str) -> Result<Self, Self::Err> {
        match input {
            "center" => Ok(Self::Center),
            "centerContinuous" => Ok(Self::CenterContinuous),
            "distributed" => Ok(Self::Distributed),
            "fill" => Ok(Self::Fill),
            "general" => Ok(Self::General),
            "justify" => Ok(Self::Justify),
            "left" => Ok(Self::Left),
            "right" => Ok(Self::Right),
            _ => Err(()),
        }
    }
}