umya_spreadsheet/structs/drawing/charts/
bar_direction_values.rs

1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum BarDirectionValues {
5    Bar,
6    Column,
7}
8impl Default for BarDirectionValues {
9    fn default() -> Self {
10        Self::Bar
11    }
12}
13impl EnumTrait for BarDirectionValues {
14    fn get_value_string(&self) -> &str {
15        match &self {
16            Self::Bar => "bar",
17            Self::Column => "col",
18        }
19    }
20}
21impl FromStr for BarDirectionValues {
22    type Err = ();
23    fn from_str(input: &str) -> Result<Self, Self::Err> {
24        match input {
25            "bar" => Ok(Self::Bar),
26            "col" => Ok(Self::Column),
27            _ => Err(()),
28        }
29    }
30}