umya_spreadsheet/structs/drawing/
tile_flip_values.rs1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum TileFlipValues {
5 Horizontal,
6 HorizontalAndVertical,
7 None,
8 Vertical,
9}
10impl Default for TileFlipValues {
11 #[inline]
12 fn default() -> Self {
13 Self::None
14 }
15}
16impl EnumTrait for TileFlipValues {
17 #[inline]
18 fn get_value_string(&self) -> &str {
19 match &self {
20 Self::Horizontal => "x",
21 Self::HorizontalAndVertical => "xy",
22 Self::None => "none",
23 Self::Vertical => "y",
24 }
25 }
26}
27impl FromStr for TileFlipValues {
28 type Err = ();
29
30 #[inline]
31 fn from_str(input: &str) -> Result<Self, Self::Err> {
32 match input {
33 "x" => Ok(Self::Horizontal),
34 "xy" => Ok(Self::HorizontalAndVertical),
35 "none" => Ok(Self::None),
36 "y" => Ok(Self::Vertical),
37 _ => Err(()),
38 }
39 }
40}