umya_spreadsheet/structs/
vertical_alignment_values.rs1use super::EnumTrait;
2use std::str::FromStr;
3#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)]
4pub enum VerticalAlignmentValues {
5 Bottom,
6 Center,
7 Distributed,
8 Justify,
9 Top,
10}
11impl Default for VerticalAlignmentValues {
12 #[inline]
13 fn default() -> Self {
14 Self::Bottom
15 }
16}
17impl EnumTrait for VerticalAlignmentValues {
18 #[inline]
19 fn get_value_string(&self) -> &str {
20 match &self {
21 Self::Bottom => "bottom",
22 Self::Center => "center",
23 Self::Distributed => "distributed",
24 Self::Justify => "justify",
25 Self::Top => "top",
26 }
27 }
28}
29impl FromStr for VerticalAlignmentValues {
30 type Err = ();
31
32 #[inline]
33 fn from_str(input: &str) -> Result<Self, Self::Err> {
34 match input {
35 "bottom" => Ok(Self::Bottom),
36 "center" => Ok(Self::Center),
37 "distributed" => Ok(Self::Distributed),
38 "justify" => Ok(Self::Justify),
39 "top" => Ok(Self::Top),
40 _ => Err(()),
41 }
42 }
43}