umya_spreadsheet/structs/drawing/charts/
shape_values.rs

1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum ShapeValues {
5    Box,
6    Cone,
7    ConeToMax,
8    Cylinder,
9    Pyramid,
10    PyramidToMaximum,
11}
12impl Default for ShapeValues {
13    fn default() -> Self {
14        Self::Cone
15    }
16}
17impl EnumTrait for ShapeValues {
18    fn get_value_string(&self) -> &str {
19        match &self {
20            Self::Box => "box",
21            Self::Cone => "cone",
22            Self::ConeToMax => "coneToMax",
23            Self::Cylinder => "cylinder",
24            Self::Pyramid => "pyramid",
25            Self::PyramidToMaximum => "pyramidToMax",
26        }
27    }
28}
29impl FromStr for ShapeValues {
30    type Err = ();
31    fn from_str(input: &str) -> Result<Self, Self::Err> {
32        match input {
33            "box" => Ok(Self::Box),
34            "cone" => Ok(Self::Cone),
35            "coneToMax" => Ok(Self::ConeToMax),
36            "cylinder" => Ok(Self::Cylinder),
37            "pyramid" => Ok(Self::Pyramid),
38            "pyramidToMax" => Ok(Self::PyramidToMaximum),
39            _ => Err(()),
40        }
41    }
42}