umya_spreadsheet/structs/
orientation_values.rs

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