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