umya_spreadsheet/structs/
underline_values.rs1use super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
4pub enum UnderlineValues {
5 Double,
6 DoubleAccounting,
7 None,
8 Single,
9 SingleAccounting,
10}
11impl Default for UnderlineValues {
12 #[inline]
13 fn default() -> Self {
14 Self::Single
15 }
16}
17impl EnumTrait for UnderlineValues {
18 #[inline]
19 fn get_value_string(&self) -> &str {
20 match &self {
21 Self::Double => "double",
22 Self::DoubleAccounting => "doubleAccounting",
23 Self::None => "none",
24 Self::Single => "single",
25 Self::SingleAccounting => "singleAccounting",
26 }
27 }
28}
29impl FromStr for UnderlineValues {
30 type Err = ();
31
32 #[inline]
33 fn from_str(input: &str) -> Result<Self, Self::Err> {
34 match input {
35 "double" => Ok(Self::Double),
36 "doubleAccounting" => Ok(Self::DoubleAccounting),
37 "none" => Ok(Self::None),
38 "single" => Ok(Self::Single),
39 "singleAccounting" => Ok(Self::SingleAccounting),
40 _ => Err(()),
41 }
42 }
43}