lewp_css/domain/properties/
unparsed_property_value.rs

1// This file is part of css. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/css/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2017 The developers of css. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/css/master/COPYRIGHT.
3
4use {
5    crate::domain::properties::{CssWideKeyword, SpecifiedValue},
6    cssparser::ToCss,
7    std::fmt,
8};
9
10#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
11pub enum UnparsedPropertyValue {
12    CssWideKeyword(CssWideKeyword),
13    SpecifiedValue(SpecifiedValue),
14}
15
16impl ToCss for UnparsedPropertyValue {
17    #[inline(always)]
18    fn to_css<W: fmt::Write>(&self, dest: &mut W) -> fmt::Result {
19        use self::UnparsedPropertyValue::*;
20
21        match *self {
22            CssWideKeyword(cssWideKeyWord) => cssWideKeyWord.to_css(dest),
23            SpecifiedValue(ref specifiedValue) => specifiedValue.to_css(dest),
24        }
25    }
26}