style/values/generics/
column.rs

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
7/// A generic type for `column-count` values.
8#[derive(
9    Animate,
10    Clone,
11    ComputeSquaredDistance,
12    Copy,
13    Debug,
14    MallocSizeOf,
15    Parse,
16    PartialEq,
17    SpecifiedValueInfo,
18    ToAnimatedValue,
19    ToAnimatedZero,
20    ToComputedValue,
21    ToCss,
22    ToResolvedValue,
23    ToShmem,
24    ToTyped,
25)]
26#[repr(u8)]
27pub enum GenericColumnCount<PositiveInteger> {
28    /// A positive integer.
29    Integer(PositiveInteger),
30    /// The keyword `auto`.
31    #[animation(error)]
32    Auto,
33}
34
35pub use self::GenericColumnCount as ColumnCount;
36impl<I> ColumnCount<I> {
37    /// Returns whether this value is `auto`.
38    #[inline]
39    pub fn is_auto(self) -> bool {
40        matches!(self, ColumnCount::Auto)
41    }
42}