umya_spreadsheet/structs/
cell_formula_values.rs

1use super::EnumTrait;
2use std::str::FromStr;
3#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)]
4pub enum CellFormulaValues {
5    Array,
6    DataTable,
7    Normal,
8    Shared,
9}
10impl Default for CellFormulaValues {
11    #[inline]
12    fn default() -> Self {
13        Self::Normal
14    }
15}
16impl EnumTrait for CellFormulaValues {
17    #[inline]
18    fn get_value_string(&self) -> &str {
19        match &self {
20            Self::Array => "array",
21            Self::DataTable => "dataTable",
22            Self::Normal => "normal",
23            Self::Shared => "shared",
24        }
25    }
26}
27impl FromStr for CellFormulaValues {
28    type Err = ();
29
30    #[inline]
31    fn from_str(input: &str) -> Result<Self, Self::Err> {
32        match input {
33            "array" => Ok(Self::Array),
34            "dataTable" => Ok(Self::DataTable),
35            "normal" => Ok(Self::Normal),
36            "shared" => Ok(Self::Shared),
37            _ => Err(()),
38        }
39    }
40}