umya_spreadsheet/structs/
border_style_values.rs

1use super::EnumTrait;
2use std::str::FromStr;
3#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)]
4pub enum BorderStyleValues {
5    DashDot,
6    DashDotDot,
7    Dashed,
8    Dotted,
9    Double,
10    Hair,
11    Medium,
12    MediumDashDot,
13    MediumDashDotDot,
14    MediumDashed,
15    None,
16    SlantDashDot,
17    Thick,
18    Thin,
19}
20impl Default for BorderStyleValues {
21    #[inline]
22    fn default() -> Self {
23        Self::None
24    }
25}
26impl EnumTrait for BorderStyleValues {
27    #[inline]
28    fn get_value_string(&self) -> &str {
29        match &self {
30            Self::DashDot => "dashDot",
31            Self::DashDotDot => "dashDotDot",
32            Self::Dashed => "dashed",
33            Self::Dotted => "dotted",
34            Self::Double => "double",
35            Self::Hair => "hair",
36            Self::Medium => "medium",
37            Self::MediumDashDot => "mediumDashDot",
38            Self::MediumDashDotDot => "mediumDashDotDot",
39            Self::MediumDashed => "mediumDashed",
40            Self::None => "none",
41            Self::SlantDashDot => "slantDashDot",
42            Self::Thick => "thick",
43            Self::Thin => "thin",
44        }
45    }
46}
47impl FromStr for BorderStyleValues {
48    type Err = ();
49
50    #[inline]
51    fn from_str(input: &str) -> Result<Self, Self::Err> {
52        match input {
53            "dashDot" => Ok(Self::DashDot),
54            "dashDotDot" => Ok(Self::DashDotDot),
55            "dashed" => Ok(Self::Dashed),
56            "dotted" => Ok(Self::Dotted),
57            "double" => Ok(Self::Double),
58            "hair" => Ok(Self::Hair),
59            "medium" => Ok(Self::Medium),
60            "mediumDashDot" => Ok(Self::MediumDashDot),
61            "mediumDashDotDot" => Ok(Self::MediumDashDotDot),
62            "mediumDashed" => Ok(Self::MediumDashed),
63            "none" => Ok(Self::None),
64            "slantDashDot" => Ok(Self::SlantDashDot),
65            "thick" => Ok(Self::Thick),
66            "thin" => Ok(Self::Thin),
67            _ => Err(()),
68        }
69    }
70}