#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Float {
Left,
Right,
#[default]
None,
}
#[cfg(feature = "parse")]
crate::util::parse::impl_parse_for_keyword_enum!(Float,
"left" => Left,
"right" => Right,
"none" => None,
);
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)]
pub enum FloatDirection {
Left = 0,
Right = 1,
}
impl Float {
pub fn is_floated(self) -> bool {
matches!(self, Self::Left | Self::Right)
}
pub fn float_direction(&self) -> Option<FloatDirection> {
match self {
Float::Left => Some(FloatDirection::Left),
Float::Right => Some(FloatDirection::Right),
Float::None => None,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Clear {
Left,
Right,
Both,
#[default]
None,
}
#[cfg(feature = "parse")]
crate::util::parse::impl_parse_for_keyword_enum!(Clear,
"left" => Left,
"right" => Right,
"both" => Both,
"none" => None,
);