1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
use internal; #[repr(u32)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde_support", serde(rename_all = "kebab-case"))] pub enum FlexDirection { Column = 0, ColumnReverse = 1, Row = 2, RowReverse = 3, } impl From<FlexDirection> for internal::YGFlexDirection { fn from(f: FlexDirection) -> internal::YGFlexDirection { match f { FlexDirection::Column => internal::YGFlexDirection::YGFlexDirectionColumn, FlexDirection::ColumnReverse => internal::YGFlexDirection::YGFlexDirectionColumnReverse, FlexDirection::Row => internal::YGFlexDirection::YGFlexDirectionRow, FlexDirection::RowReverse => internal::YGFlexDirection::YGFlexDirectionRowReverse, } } } impl From<internal::YGFlexDirection> for FlexDirection { fn from(f: internal::YGFlexDirection) -> FlexDirection { match f { internal::YGFlexDirection::YGFlexDirectionColumn => FlexDirection::Column, internal::YGFlexDirection::YGFlexDirectionColumnReverse => FlexDirection::ColumnReverse, internal::YGFlexDirection::YGFlexDirectionRow => FlexDirection::Row, internal::YGFlexDirection::YGFlexDirectionRowReverse => FlexDirection::RowReverse, } } }