use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum LayoutDirection {
TopToBottom,
LeftToRight,
BottomToTop,
RightToLeft,
}
impl LayoutDirection {
pub fn direction(&self) -> &'static str {
match self {
LayoutDirection::TopToBottom => "TB",
LayoutDirection::LeftToRight => "LR",
LayoutDirection::BottomToTop => "BT",
LayoutDirection::RightToLeft => "RL",
}
}
}
impl fmt::Display for LayoutDirection {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.direction())
}
}