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
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 PositionType { Relative = 0, Absolute = 1, } impl From<PositionType> for internal::YGPositionType { fn from(p: PositionType) -> internal::YGPositionType { match p { PositionType::Relative => internal::YGPositionType::YGPositionTypeRelative, PositionType::Absolute => internal::YGPositionType::YGPositionTypeAbsolute, } } } impl From<internal::YGPositionType> for PositionType { fn from(p: internal::YGPositionType) -> PositionType { match p { internal::YGPositionType::YGPositionTypeRelative => PositionType::Relative, internal::YGPositionType::YGPositionTypeAbsolute => PositionType::Absolute, } } }