column.rs (997B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 //! Generic types for the column properties. 6 use crate::derives::*; 7 8 /// A generic type for `column-count` values. 9 #[derive( 10 Animate, 11 Clone, 12 ComputeSquaredDistance, 13 Copy, 14 Debug, 15 MallocSizeOf, 16 Parse, 17 PartialEq, 18 SpecifiedValueInfo, 19 ToAnimatedValue, 20 ToAnimatedZero, 21 ToComputedValue, 22 ToCss, 23 ToResolvedValue, 24 ToShmem, 25 ToTyped, 26 )] 27 #[repr(u8)] 28 pub enum GenericColumnCount<PositiveInteger> { 29 /// A positive integer. 30 Integer(PositiveInteger), 31 /// The keyword `auto`. 32 #[animation(error)] 33 Auto, 34 } 35 36 pub use self::GenericColumnCount as ColumnCount; 37 impl<I> ColumnCount<I> { 38 /// Returns whether this value is `auto`. 39 #[inline] 40 pub fn is_auto(self) -> bool { 41 matches!(self, ColumnCount::Auto) 42 } 43 }