umya_spreadsheet/structs/drawing/charts/
grouping_values.rs

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