umya_spreadsheet/structs/drawing/charts/
axis_position_values.rs

1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum AxisPositionValues {
5    Bottom,
6    Left,
7    Right,
8    Top,
9}
10impl Default for AxisPositionValues {
11    fn default() -> Self {
12        Self::Bottom
13    }
14}
15impl EnumTrait for AxisPositionValues {
16    fn get_value_string(&self) -> &str {
17        match &self {
18            Self::Bottom => "b",
19            Self::Left => "l",
20            Self::Right => "r",
21            Self::Top => "t",
22        }
23    }
24}
25impl FromStr for AxisPositionValues {
26    type Err = ();
27    fn from_str(input: &str) -> Result<Self, Self::Err> {
28        match input {
29            "b" => Ok(Self::Bottom),
30            "l" => Ok(Self::Left),
31            "r" => Ok(Self::Right),
32            "t" => Ok(Self::Top),
33            _ => Err(()),
34        }
35    }
36}