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