umya_spreadsheet/structs/drawing/
light_rig_direction_values.rs

1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum LightRigDirectionValues {
5    Bottom,
6    BottomLeft,
7    BottomRight,
8    Left,
9    Right,
10    Top,
11    TopLeft,
12    TopRight,
13}
14impl Default for LightRigDirectionValues {
15    #[inline]
16    fn default() -> Self {
17        Self::TopLeft
18    }
19}
20impl EnumTrait for LightRigDirectionValues {
21    #[inline]
22    fn get_value_string(&self) -> &str {
23        match &self {
24            Self::Bottom => "b",
25            Self::BottomLeft => "bl",
26            Self::BottomRight => "br",
27            Self::Left => "l",
28            Self::Right => "r",
29            Self::Top => "t",
30            Self::TopLeft => "tl",
31            Self::TopRight => "tr",
32        }
33    }
34}
35impl FromStr for LightRigDirectionValues {
36    type Err = ();
37
38    #[inline]
39    fn from_str(input: &str) -> Result<Self, Self::Err> {
40        match input {
41            "b" => Ok(Self::Bottom),
42            "bl" => Ok(Self::BottomLeft),
43            "br" => Ok(Self::BottomRight),
44            "l" => Ok(Self::Left),
45            "r" => Ok(Self::Right),
46            "t" => Ok(Self::Top),
47            "tl" => Ok(Self::TopLeft),
48            "tr" => Ok(Self::TopRight),
49            _ => Err(()),
50        }
51    }
52}