1#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
8#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9pub enum Float {
10 Left,
12 Right,
14 #[default]
16 None,
17}
18
19#[cfg(feature = "parse")]
20crate::util::parse::impl_parse_for_keyword_enum!(Float,
21 "left" => Left,
22 "right" => Right,
23 "none" => None,
24);
25
26#[derive(Debug, Copy, Clone, PartialEq, Eq)]
31#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32#[repr(u8)]
33pub enum FloatDirection {
34 Left = 0,
36 Right = 1,
38}
39
40impl Float {
41 pub fn is_floated(self) -> bool {
43 matches!(self, Self::Left | Self::Right)
44 }
45
46 pub fn float_direction(&self) -> Option<FloatDirection> {
48 match self {
49 Float::Left => Some(FloatDirection::Left),
50 Float::Right => Some(FloatDirection::Right),
51 Float::None => None,
52 }
53 }
54}
55
56#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
61#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
62pub enum Clear {
63 Left,
65 Right,
67 Both,
69 #[default]
71 None,
72}
73
74#[cfg(feature = "parse")]
75crate::util::parse::impl_parse_for_keyword_enum!(Clear,
76 "left" => Left,
77 "right" => Right,
78 "both" => Both,
79 "none" => None,
80);