umya_spreadsheet/structs/drawing/spreadsheet/
edit_as_values.rs

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