umya_spreadsheet/structs/drawing/
pen_alignment_values.rs

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