Enum swc_css_ast::ComponentValue
source · pub enum ComponentValue {
Show 32 variants
PreservedToken(Box<TokenAndSpan>),
Function(Box<Function>),
SimpleBlock(Box<SimpleBlock>),
AtRule(Box<AtRule>),
QualifiedRule(Box<QualifiedRule>),
ListOfComponentValues(Box<ListOfComponentValues>),
KeyframeBlock(Box<KeyframeBlock>),
Ident(Box<Ident>),
DashedIdent(Box<DashedIdent>),
Str(Box<Str>),
Url(Box<Url>),
Integer(Box<Integer>),
Number(Box<Number>),
Percentage(Box<Percentage>),
Dimension(Box<Dimension>),
LengthPercentage(Box<LengthPercentage>),
FrequencyPercentage(Box<FrequencyPercentage>),
AnglePercentage(Box<AnglePercentage>),
TimePercentage(Box<TimePercentage>),
Ratio(Box<Ratio>),
UnicodeRange(Box<UnicodeRange>),
Color(Box<Color>),
AlphaValue(Box<AlphaValue>),
Hue(Box<Hue>),
CmykComponent(Box<CmykComponent>),
Delimiter(Box<Delimiter>),
CalcSum(Box<CalcSum>),
ComplexSelector(Box<ComplexSelector>),
LayerName(Box<LayerName>),
SupportsCondition(Box<SupportsCondition>),
Declaration(Box<Declaration>),
IdSelector(Box<IdSelector>),
}
Variants§
PreservedToken(Box<TokenAndSpan>)
Function(Box<Function>)
SimpleBlock(Box<SimpleBlock>)
AtRule(Box<AtRule>)
QualifiedRule(Box<QualifiedRule>)
ListOfComponentValues(Box<ListOfComponentValues>)
KeyframeBlock(Box<KeyframeBlock>)
Ident(Box<Ident>)
DashedIdent(Box<DashedIdent>)
Str(Box<Str>)
Url(Box<Url>)
Integer(Box<Integer>)
Number(Box<Number>)
Percentage(Box<Percentage>)
Dimension(Box<Dimension>)
LengthPercentage(Box<LengthPercentage>)
FrequencyPercentage(Box<FrequencyPercentage>)
AnglePercentage(Box<AnglePercentage>)
TimePercentage(Box<TimePercentage>)
Ratio(Box<Ratio>)
UnicodeRange(Box<UnicodeRange>)
Color(Box<Color>)
AlphaValue(Box<AlphaValue>)
Hue(Box<Hue>)
CmykComponent(Box<CmykComponent>)
Delimiter(Box<Delimiter>)
CalcSum(Box<CalcSum>)
ComplexSelector(Box<ComplexSelector>)
LayerName(Box<LayerName>)
SupportsCondition(Box<SupportsCondition>)
Declaration(Box<Declaration>)
IdSelector(Box<IdSelector>)
Implementations§
source§impl ComponentValue
impl ComponentValue
sourcepub const fn is_preserved_token(&self) -> bool
pub const fn is_preserved_token(&self) -> bool
Returns true
if self
is of variant PreservedToken
.
sourcepub fn as_preserved_token(&self) -> Option<&Box<TokenAndSpan>>
pub fn as_preserved_token(&self) -> Option<&Box<TokenAndSpan>>
Returns Some
if self
is a reference of variant PreservedToken
, and None
otherwise.
sourcepub fn as_mut_preserved_token(&mut self) -> Option<&mut Box<TokenAndSpan>>
pub fn as_mut_preserved_token(&mut self) -> Option<&mut Box<TokenAndSpan>>
Returns Some
if self
is a mutable reference of variant PreservedToken
, and None
otherwise.
sourcepub fn expect_preserved_token(self) -> Box<TokenAndSpan>where
Self: Debug,
pub fn expect_preserved_token(self) -> Box<TokenAndSpan>where Self: Debug,
Unwraps the value, yielding the content of PreservedToken
.
Panics
Panics if the value is not PreservedToken
, with a panic message including the content of self
.
sourcepub fn preserved_token(self) -> Option<Box<TokenAndSpan>>
pub fn preserved_token(self) -> Option<Box<TokenAndSpan>>
Returns Some
if self
is of variant PreservedToken
, and None
otherwise.
sourcepub const fn is_function(&self) -> bool
pub const fn is_function(&self) -> bool
Returns true
if self
is of variant Function
.
sourcepub fn as_function(&self) -> Option<&Box<Function>>
pub fn as_function(&self) -> Option<&Box<Function>>
Returns Some
if self
is a reference of variant Function
, and None
otherwise.
sourcepub fn as_mut_function(&mut self) -> Option<&mut Box<Function>>
pub fn as_mut_function(&mut self) -> Option<&mut Box<Function>>
Returns Some
if self
is a mutable reference of variant Function
, and None
otherwise.
sourcepub fn expect_function(self) -> Box<Function>where
Self: Debug,
pub fn expect_function(self) -> Box<Function>where Self: Debug,
sourcepub fn function(self) -> Option<Box<Function>>
pub fn function(self) -> Option<Box<Function>>
Returns Some
if self
is of variant Function
, and None
otherwise.
sourcepub const fn is_simple_block(&self) -> bool
pub const fn is_simple_block(&self) -> bool
Returns true
if self
is of variant SimpleBlock
.
sourcepub fn as_simple_block(&self) -> Option<&Box<SimpleBlock>>
pub fn as_simple_block(&self) -> Option<&Box<SimpleBlock>>
Returns Some
if self
is a reference of variant SimpleBlock
, and None
otherwise.
sourcepub fn as_mut_simple_block(&mut self) -> Option<&mut Box<SimpleBlock>>
pub fn as_mut_simple_block(&mut self) -> Option<&mut Box<SimpleBlock>>
Returns Some
if self
is a mutable reference of variant SimpleBlock
, and None
otherwise.
sourcepub fn expect_simple_block(self) -> Box<SimpleBlock>where
Self: Debug,
pub fn expect_simple_block(self) -> Box<SimpleBlock>where Self: Debug,
Unwraps the value, yielding the content of SimpleBlock
.
Panics
Panics if the value is not SimpleBlock
, with a panic message including the content of self
.
sourcepub fn simple_block(self) -> Option<Box<SimpleBlock>>
pub fn simple_block(self) -> Option<Box<SimpleBlock>>
Returns Some
if self
is of variant SimpleBlock
, and None
otherwise.
sourcepub const fn is_at_rule(&self) -> bool
pub const fn is_at_rule(&self) -> bool
Returns true
if self
is of variant AtRule
.
sourcepub fn as_at_rule(&self) -> Option<&Box<AtRule>>
pub fn as_at_rule(&self) -> Option<&Box<AtRule>>
Returns Some
if self
is a reference of variant AtRule
, and None
otherwise.
sourcepub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
pub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
Returns Some
if self
is a mutable reference of variant AtRule
, and None
otherwise.
sourcepub fn expect_at_rule(self) -> Box<AtRule>where
Self: Debug,
pub fn expect_at_rule(self) -> Box<AtRule>where Self: Debug,
sourcepub fn at_rule(self) -> Option<Box<AtRule>>
pub fn at_rule(self) -> Option<Box<AtRule>>
Returns Some
if self
is of variant AtRule
, and None
otherwise.
sourcepub const fn is_qualified_rule(&self) -> bool
pub const fn is_qualified_rule(&self) -> bool
Returns true
if self
is of variant QualifiedRule
.
sourcepub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
pub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
Returns Some
if self
is a reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
pub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
Returns Some
if self
is a mutable reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn expect_qualified_rule(self) -> Box<QualifiedRule>where
Self: Debug,
pub fn expect_qualified_rule(self) -> Box<QualifiedRule>where Self: Debug,
Unwraps the value, yielding the content of QualifiedRule
.
Panics
Panics if the value is not QualifiedRule
, with a panic message including the content of self
.
sourcepub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
pub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
Returns Some
if self
is of variant QualifiedRule
, and None
otherwise.
sourcepub const fn is_list_of_component_values(&self) -> bool
pub const fn is_list_of_component_values(&self) -> bool
Returns true
if self
is of variant ListOfComponentValues
.
sourcepub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
pub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
Returns Some
if self
is a reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn as_mut_list_of_component_values(
&mut self
) -> Option<&mut Box<ListOfComponentValues>>
pub fn as_mut_list_of_component_values( &mut self ) -> Option<&mut Box<ListOfComponentValues>>
Returns Some
if self
is a mutable reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where
Self: Debug,
pub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where Self: Debug,
Unwraps the value, yielding the content of ListOfComponentValues
.
Panics
Panics if the value is not ListOfComponentValues
, with a panic message including the content of self
.
sourcepub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
pub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
Returns Some
if self
is of variant ListOfComponentValues
, and None
otherwise.
sourcepub const fn is_keyframe_block(&self) -> bool
pub const fn is_keyframe_block(&self) -> bool
Returns true
if self
is of variant KeyframeBlock
.
sourcepub fn as_keyframe_block(&self) -> Option<&Box<KeyframeBlock>>
pub fn as_keyframe_block(&self) -> Option<&Box<KeyframeBlock>>
Returns Some
if self
is a reference of variant KeyframeBlock
, and None
otherwise.
sourcepub fn as_mut_keyframe_block(&mut self) -> Option<&mut Box<KeyframeBlock>>
pub fn as_mut_keyframe_block(&mut self) -> Option<&mut Box<KeyframeBlock>>
Returns Some
if self
is a mutable reference of variant KeyframeBlock
, and None
otherwise.
sourcepub fn expect_keyframe_block(self) -> Box<KeyframeBlock>where
Self: Debug,
pub fn expect_keyframe_block(self) -> Box<KeyframeBlock>where Self: Debug,
Unwraps the value, yielding the content of KeyframeBlock
.
Panics
Panics if the value is not KeyframeBlock
, with a panic message including the content of self
.
sourcepub fn keyframe_block(self) -> Option<Box<KeyframeBlock>>
pub fn keyframe_block(self) -> Option<Box<KeyframeBlock>>
Returns Some
if self
is of variant KeyframeBlock
, and None
otherwise.
sourcepub fn as_ident(&self) -> Option<&Box<Ident>>
pub fn as_ident(&self) -> Option<&Box<Ident>>
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
sourcepub fn as_mut_ident(&mut self) -> Option<&mut Box<Ident>>
pub fn as_mut_ident(&mut self) -> Option<&mut Box<Ident>>
Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
sourcepub fn expect_ident(self) -> Box<Ident>where
Self: Debug,
pub fn expect_ident(self) -> Box<Ident>where Self: Debug,
sourcepub fn ident(self) -> Option<Box<Ident>>
pub fn ident(self) -> Option<Box<Ident>>
Returns Some
if self
is of variant Ident
, and None
otherwise.
sourcepub const fn is_dashed_ident(&self) -> bool
pub const fn is_dashed_ident(&self) -> bool
Returns true
if self
is of variant DashedIdent
.
sourcepub fn as_dashed_ident(&self) -> Option<&Box<DashedIdent>>
pub fn as_dashed_ident(&self) -> Option<&Box<DashedIdent>>
Returns Some
if self
is a reference of variant DashedIdent
, and None
otherwise.
sourcepub fn as_mut_dashed_ident(&mut self) -> Option<&mut Box<DashedIdent>>
pub fn as_mut_dashed_ident(&mut self) -> Option<&mut Box<DashedIdent>>
Returns Some
if self
is a mutable reference of variant DashedIdent
, and None
otherwise.
sourcepub fn expect_dashed_ident(self) -> Box<DashedIdent>where
Self: Debug,
pub fn expect_dashed_ident(self) -> Box<DashedIdent>where Self: Debug,
Unwraps the value, yielding the content of DashedIdent
.
Panics
Panics if the value is not DashedIdent
, with a panic message including the content of self
.
sourcepub fn dashed_ident(self) -> Option<Box<DashedIdent>>
pub fn dashed_ident(self) -> Option<Box<DashedIdent>>
Returns Some
if self
is of variant DashedIdent
, and None
otherwise.
sourcepub fn as_str(&self) -> Option<&Box<Str>>
pub fn as_str(&self) -> Option<&Box<Str>>
Returns Some
if self
is a reference of variant Str
, and None
otherwise.
sourcepub fn as_mut_str(&mut self) -> Option<&mut Box<Str>>
pub fn as_mut_str(&mut self) -> Option<&mut Box<Str>>
Returns Some
if self
is a mutable reference of variant Str
, and None
otherwise.
sourcepub fn expect_str(self) -> Box<Str>where
Self: Debug,
pub fn expect_str(self) -> Box<Str>where Self: Debug,
sourcepub fn str(self) -> Option<Box<Str>>
pub fn str(self) -> Option<Box<Str>>
Returns Some
if self
is of variant Str
, and None
otherwise.
sourcepub fn as_url(&self) -> Option<&Box<Url>>
pub fn as_url(&self) -> Option<&Box<Url>>
Returns Some
if self
is a reference of variant Url
, and None
otherwise.
sourcepub fn as_mut_url(&mut self) -> Option<&mut Box<Url>>
pub fn as_mut_url(&mut self) -> Option<&mut Box<Url>>
Returns Some
if self
is a mutable reference of variant Url
, and None
otherwise.
sourcepub fn expect_url(self) -> Box<Url>where
Self: Debug,
pub fn expect_url(self) -> Box<Url>where Self: Debug,
sourcepub fn url(self) -> Option<Box<Url>>
pub fn url(self) -> Option<Box<Url>>
Returns Some
if self
is of variant Url
, and None
otherwise.
sourcepub const fn is_integer(&self) -> bool
pub const fn is_integer(&self) -> bool
Returns true
if self
is of variant Integer
.
sourcepub fn as_integer(&self) -> Option<&Box<Integer>>
pub fn as_integer(&self) -> Option<&Box<Integer>>
Returns Some
if self
is a reference of variant Integer
, and None
otherwise.
sourcepub fn as_mut_integer(&mut self) -> Option<&mut Box<Integer>>
pub fn as_mut_integer(&mut self) -> Option<&mut Box<Integer>>
Returns Some
if self
is a mutable reference of variant Integer
, and None
otherwise.
sourcepub fn expect_integer(self) -> Box<Integer>where
Self: Debug,
pub fn expect_integer(self) -> Box<Integer>where Self: Debug,
sourcepub fn integer(self) -> Option<Box<Integer>>
pub fn integer(self) -> Option<Box<Integer>>
Returns Some
if self
is of variant Integer
, and None
otherwise.
sourcepub fn as_number(&self) -> Option<&Box<Number>>
pub fn as_number(&self) -> Option<&Box<Number>>
Returns Some
if self
is a reference of variant Number
, and None
otherwise.
sourcepub fn as_mut_number(&mut self) -> Option<&mut Box<Number>>
pub fn as_mut_number(&mut self) -> Option<&mut Box<Number>>
Returns Some
if self
is a mutable reference of variant Number
, and None
otherwise.
sourcepub fn expect_number(self) -> Box<Number>where
Self: Debug,
pub fn expect_number(self) -> Box<Number>where Self: Debug,
sourcepub fn number(self) -> Option<Box<Number>>
pub fn number(self) -> Option<Box<Number>>
Returns Some
if self
is of variant Number
, and None
otherwise.
sourcepub const fn is_percentage(&self) -> bool
pub const fn is_percentage(&self) -> bool
Returns true
if self
is of variant Percentage
.
sourcepub fn as_percentage(&self) -> Option<&Box<Percentage>>
pub fn as_percentage(&self) -> Option<&Box<Percentage>>
Returns Some
if self
is a reference of variant Percentage
, and None
otherwise.
sourcepub fn as_mut_percentage(&mut self) -> Option<&mut Box<Percentage>>
pub fn as_mut_percentage(&mut self) -> Option<&mut Box<Percentage>>
Returns Some
if self
is a mutable reference of variant Percentage
, and None
otherwise.
sourcepub fn expect_percentage(self) -> Box<Percentage>where
Self: Debug,
pub fn expect_percentage(self) -> Box<Percentage>where Self: Debug,
Unwraps the value, yielding the content of Percentage
.
Panics
Panics if the value is not Percentage
, with a panic message including the content of self
.
sourcepub fn percentage(self) -> Option<Box<Percentage>>
pub fn percentage(self) -> Option<Box<Percentage>>
Returns Some
if self
is of variant Percentage
, and None
otherwise.
sourcepub const fn is_dimension(&self) -> bool
pub const fn is_dimension(&self) -> bool
Returns true
if self
is of variant Dimension
.
sourcepub fn as_dimension(&self) -> Option<&Box<Dimension>>
pub fn as_dimension(&self) -> Option<&Box<Dimension>>
Returns Some
if self
is a reference of variant Dimension
, and None
otherwise.
sourcepub fn as_mut_dimension(&mut self) -> Option<&mut Box<Dimension>>
pub fn as_mut_dimension(&mut self) -> Option<&mut Box<Dimension>>
Returns Some
if self
is a mutable reference of variant Dimension
, and None
otherwise.
sourcepub fn expect_dimension(self) -> Box<Dimension>where
Self: Debug,
pub fn expect_dimension(self) -> Box<Dimension>where Self: Debug,
sourcepub fn dimension(self) -> Option<Box<Dimension>>
pub fn dimension(self) -> Option<Box<Dimension>>
Returns Some
if self
is of variant Dimension
, and None
otherwise.
sourcepub const fn is_length_percentage(&self) -> bool
pub const fn is_length_percentage(&self) -> bool
Returns true
if self
is of variant LengthPercentage
.
sourcepub fn as_length_percentage(&self) -> Option<&Box<LengthPercentage>>
pub fn as_length_percentage(&self) -> Option<&Box<LengthPercentage>>
Returns Some
if self
is a reference of variant LengthPercentage
, and None
otherwise.
sourcepub fn as_mut_length_percentage(&mut self) -> Option<&mut Box<LengthPercentage>>
pub fn as_mut_length_percentage(&mut self) -> Option<&mut Box<LengthPercentage>>
Returns Some
if self
is a mutable reference of variant LengthPercentage
, and None
otherwise.
sourcepub fn expect_length_percentage(self) -> Box<LengthPercentage>where
Self: Debug,
pub fn expect_length_percentage(self) -> Box<LengthPercentage>where Self: Debug,
Unwraps the value, yielding the content of LengthPercentage
.
Panics
Panics if the value is not LengthPercentage
, with a panic message including the content of self
.
sourcepub fn length_percentage(self) -> Option<Box<LengthPercentage>>
pub fn length_percentage(self) -> Option<Box<LengthPercentage>>
Returns Some
if self
is of variant LengthPercentage
, and None
otherwise.
sourcepub const fn is_frequency_percentage(&self) -> bool
pub const fn is_frequency_percentage(&self) -> bool
Returns true
if self
is of variant FrequencyPercentage
.
sourcepub fn as_frequency_percentage(&self) -> Option<&Box<FrequencyPercentage>>
pub fn as_frequency_percentage(&self) -> Option<&Box<FrequencyPercentage>>
Returns Some
if self
is a reference of variant FrequencyPercentage
, and None
otherwise.
sourcepub fn as_mut_frequency_percentage(
&mut self
) -> Option<&mut Box<FrequencyPercentage>>
pub fn as_mut_frequency_percentage( &mut self ) -> Option<&mut Box<FrequencyPercentage>>
Returns Some
if self
is a mutable reference of variant FrequencyPercentage
, and None
otherwise.
sourcepub fn expect_frequency_percentage(self) -> Box<FrequencyPercentage>where
Self: Debug,
pub fn expect_frequency_percentage(self) -> Box<FrequencyPercentage>where Self: Debug,
Unwraps the value, yielding the content of FrequencyPercentage
.
Panics
Panics if the value is not FrequencyPercentage
, with a panic message including the content of self
.
sourcepub fn frequency_percentage(self) -> Option<Box<FrequencyPercentage>>
pub fn frequency_percentage(self) -> Option<Box<FrequencyPercentage>>
Returns Some
if self
is of variant FrequencyPercentage
, and None
otherwise.
sourcepub const fn is_angle_percentage(&self) -> bool
pub const fn is_angle_percentage(&self) -> bool
Returns true
if self
is of variant AnglePercentage
.
sourcepub fn as_angle_percentage(&self) -> Option<&Box<AnglePercentage>>
pub fn as_angle_percentage(&self) -> Option<&Box<AnglePercentage>>
Returns Some
if self
is a reference of variant AnglePercentage
, and None
otherwise.
sourcepub fn as_mut_angle_percentage(&mut self) -> Option<&mut Box<AnglePercentage>>
pub fn as_mut_angle_percentage(&mut self) -> Option<&mut Box<AnglePercentage>>
Returns Some
if self
is a mutable reference of variant AnglePercentage
, and None
otherwise.
sourcepub fn expect_angle_percentage(self) -> Box<AnglePercentage>where
Self: Debug,
pub fn expect_angle_percentage(self) -> Box<AnglePercentage>where Self: Debug,
Unwraps the value, yielding the content of AnglePercentage
.
Panics
Panics if the value is not AnglePercentage
, with a panic message including the content of self
.
sourcepub fn angle_percentage(self) -> Option<Box<AnglePercentage>>
pub fn angle_percentage(self) -> Option<Box<AnglePercentage>>
Returns Some
if self
is of variant AnglePercentage
, and None
otherwise.
sourcepub const fn is_time_percentage(&self) -> bool
pub const fn is_time_percentage(&self) -> bool
Returns true
if self
is of variant TimePercentage
.
sourcepub fn as_time_percentage(&self) -> Option<&Box<TimePercentage>>
pub fn as_time_percentage(&self) -> Option<&Box<TimePercentage>>
Returns Some
if self
is a reference of variant TimePercentage
, and None
otherwise.
sourcepub fn as_mut_time_percentage(&mut self) -> Option<&mut Box<TimePercentage>>
pub fn as_mut_time_percentage(&mut self) -> Option<&mut Box<TimePercentage>>
Returns Some
if self
is a mutable reference of variant TimePercentage
, and None
otherwise.
sourcepub fn expect_time_percentage(self) -> Box<TimePercentage>where
Self: Debug,
pub fn expect_time_percentage(self) -> Box<TimePercentage>where Self: Debug,
Unwraps the value, yielding the content of TimePercentage
.
Panics
Panics if the value is not TimePercentage
, with a panic message including the content of self
.
sourcepub fn time_percentage(self) -> Option<Box<TimePercentage>>
pub fn time_percentage(self) -> Option<Box<TimePercentage>>
Returns Some
if self
is of variant TimePercentage
, and None
otherwise.
sourcepub fn as_ratio(&self) -> Option<&Box<Ratio>>
pub fn as_ratio(&self) -> Option<&Box<Ratio>>
Returns Some
if self
is a reference of variant Ratio
, and None
otherwise.
sourcepub fn as_mut_ratio(&mut self) -> Option<&mut Box<Ratio>>
pub fn as_mut_ratio(&mut self) -> Option<&mut Box<Ratio>>
Returns Some
if self
is a mutable reference of variant Ratio
, and None
otherwise.
sourcepub fn expect_ratio(self) -> Box<Ratio>where
Self: Debug,
pub fn expect_ratio(self) -> Box<Ratio>where Self: Debug,
sourcepub fn ratio(self) -> Option<Box<Ratio>>
pub fn ratio(self) -> Option<Box<Ratio>>
Returns Some
if self
is of variant Ratio
, and None
otherwise.
sourcepub const fn is_unicode_range(&self) -> bool
pub const fn is_unicode_range(&self) -> bool
Returns true
if self
is of variant UnicodeRange
.
sourcepub fn as_unicode_range(&self) -> Option<&Box<UnicodeRange>>
pub fn as_unicode_range(&self) -> Option<&Box<UnicodeRange>>
Returns Some
if self
is a reference of variant UnicodeRange
, and None
otherwise.
sourcepub fn as_mut_unicode_range(&mut self) -> Option<&mut Box<UnicodeRange>>
pub fn as_mut_unicode_range(&mut self) -> Option<&mut Box<UnicodeRange>>
Returns Some
if self
is a mutable reference of variant UnicodeRange
, and None
otherwise.
sourcepub fn expect_unicode_range(self) -> Box<UnicodeRange>where
Self: Debug,
pub fn expect_unicode_range(self) -> Box<UnicodeRange>where Self: Debug,
Unwraps the value, yielding the content of UnicodeRange
.
Panics
Panics if the value is not UnicodeRange
, with a panic message including the content of self
.
sourcepub fn unicode_range(self) -> Option<Box<UnicodeRange>>
pub fn unicode_range(self) -> Option<Box<UnicodeRange>>
Returns Some
if self
is of variant UnicodeRange
, and None
otherwise.
sourcepub fn as_color(&self) -> Option<&Box<Color>>
pub fn as_color(&self) -> Option<&Box<Color>>
Returns Some
if self
is a reference of variant Color
, and None
otherwise.
sourcepub fn as_mut_color(&mut self) -> Option<&mut Box<Color>>
pub fn as_mut_color(&mut self) -> Option<&mut Box<Color>>
Returns Some
if self
is a mutable reference of variant Color
, and None
otherwise.
sourcepub fn expect_color(self) -> Box<Color>where
Self: Debug,
pub fn expect_color(self) -> Box<Color>where Self: Debug,
sourcepub fn color(self) -> Option<Box<Color>>
pub fn color(self) -> Option<Box<Color>>
Returns Some
if self
is of variant Color
, and None
otherwise.
sourcepub const fn is_alpha_value(&self) -> bool
pub const fn is_alpha_value(&self) -> bool
Returns true
if self
is of variant AlphaValue
.
sourcepub fn as_alpha_value(&self) -> Option<&Box<AlphaValue>>
pub fn as_alpha_value(&self) -> Option<&Box<AlphaValue>>
Returns Some
if self
is a reference of variant AlphaValue
, and None
otherwise.
sourcepub fn as_mut_alpha_value(&mut self) -> Option<&mut Box<AlphaValue>>
pub fn as_mut_alpha_value(&mut self) -> Option<&mut Box<AlphaValue>>
Returns Some
if self
is a mutable reference of variant AlphaValue
, and None
otherwise.
sourcepub fn expect_alpha_value(self) -> Box<AlphaValue>where
Self: Debug,
pub fn expect_alpha_value(self) -> Box<AlphaValue>where Self: Debug,
Unwraps the value, yielding the content of AlphaValue
.
Panics
Panics if the value is not AlphaValue
, with a panic message including the content of self
.
sourcepub fn alpha_value(self) -> Option<Box<AlphaValue>>
pub fn alpha_value(self) -> Option<Box<AlphaValue>>
Returns Some
if self
is of variant AlphaValue
, and None
otherwise.
sourcepub fn as_hue(&self) -> Option<&Box<Hue>>
pub fn as_hue(&self) -> Option<&Box<Hue>>
Returns Some
if self
is a reference of variant Hue
, and None
otherwise.
sourcepub fn as_mut_hue(&mut self) -> Option<&mut Box<Hue>>
pub fn as_mut_hue(&mut self) -> Option<&mut Box<Hue>>
Returns Some
if self
is a mutable reference of variant Hue
, and None
otherwise.
sourcepub fn expect_hue(self) -> Box<Hue>where
Self: Debug,
pub fn expect_hue(self) -> Box<Hue>where Self: Debug,
sourcepub fn hue(self) -> Option<Box<Hue>>
pub fn hue(self) -> Option<Box<Hue>>
Returns Some
if self
is of variant Hue
, and None
otherwise.
sourcepub const fn is_cmyk_component(&self) -> bool
pub const fn is_cmyk_component(&self) -> bool
Returns true
if self
is of variant CmykComponent
.
sourcepub fn as_cmyk_component(&self) -> Option<&Box<CmykComponent>>
pub fn as_cmyk_component(&self) -> Option<&Box<CmykComponent>>
Returns Some
if self
is a reference of variant CmykComponent
, and None
otherwise.
sourcepub fn as_mut_cmyk_component(&mut self) -> Option<&mut Box<CmykComponent>>
pub fn as_mut_cmyk_component(&mut self) -> Option<&mut Box<CmykComponent>>
Returns Some
if self
is a mutable reference of variant CmykComponent
, and None
otherwise.
sourcepub fn expect_cmyk_component(self) -> Box<CmykComponent>where
Self: Debug,
pub fn expect_cmyk_component(self) -> Box<CmykComponent>where Self: Debug,
Unwraps the value, yielding the content of CmykComponent
.
Panics
Panics if the value is not CmykComponent
, with a panic message including the content of self
.
sourcepub fn cmyk_component(self) -> Option<Box<CmykComponent>>
pub fn cmyk_component(self) -> Option<Box<CmykComponent>>
Returns Some
if self
is of variant CmykComponent
, and None
otherwise.
sourcepub const fn is_delimiter(&self) -> bool
pub const fn is_delimiter(&self) -> bool
Returns true
if self
is of variant Delimiter
.
sourcepub fn as_delimiter(&self) -> Option<&Box<Delimiter>>
pub fn as_delimiter(&self) -> Option<&Box<Delimiter>>
Returns Some
if self
is a reference of variant Delimiter
, and None
otherwise.
sourcepub fn as_mut_delimiter(&mut self) -> Option<&mut Box<Delimiter>>
pub fn as_mut_delimiter(&mut self) -> Option<&mut Box<Delimiter>>
Returns Some
if self
is a mutable reference of variant Delimiter
, and None
otherwise.
sourcepub fn expect_delimiter(self) -> Box<Delimiter>where
Self: Debug,
pub fn expect_delimiter(self) -> Box<Delimiter>where Self: Debug,
sourcepub fn delimiter(self) -> Option<Box<Delimiter>>
pub fn delimiter(self) -> Option<Box<Delimiter>>
Returns Some
if self
is of variant Delimiter
, and None
otherwise.
sourcepub const fn is_calc_sum(&self) -> bool
pub const fn is_calc_sum(&self) -> bool
Returns true
if self
is of variant CalcSum
.
sourcepub fn as_calc_sum(&self) -> Option<&Box<CalcSum>>
pub fn as_calc_sum(&self) -> Option<&Box<CalcSum>>
Returns Some
if self
is a reference of variant CalcSum
, and None
otherwise.
sourcepub fn as_mut_calc_sum(&mut self) -> Option<&mut Box<CalcSum>>
pub fn as_mut_calc_sum(&mut self) -> Option<&mut Box<CalcSum>>
Returns Some
if self
is a mutable reference of variant CalcSum
, and None
otherwise.
sourcepub fn expect_calc_sum(self) -> Box<CalcSum>where
Self: Debug,
pub fn expect_calc_sum(self) -> Box<CalcSum>where Self: Debug,
sourcepub fn calc_sum(self) -> Option<Box<CalcSum>>
pub fn calc_sum(self) -> Option<Box<CalcSum>>
Returns Some
if self
is of variant CalcSum
, and None
otherwise.
sourcepub const fn is_complex_selector(&self) -> bool
pub const fn is_complex_selector(&self) -> bool
Returns true
if self
is of variant ComplexSelector
.
sourcepub fn as_complex_selector(&self) -> Option<&Box<ComplexSelector>>
pub fn as_complex_selector(&self) -> Option<&Box<ComplexSelector>>
Returns Some
if self
is a reference of variant ComplexSelector
, and None
otherwise.
sourcepub fn as_mut_complex_selector(&mut self) -> Option<&mut Box<ComplexSelector>>
pub fn as_mut_complex_selector(&mut self) -> Option<&mut Box<ComplexSelector>>
Returns Some
if self
is a mutable reference of variant ComplexSelector
, and None
otherwise.
sourcepub fn expect_complex_selector(self) -> Box<ComplexSelector>where
Self: Debug,
pub fn expect_complex_selector(self) -> Box<ComplexSelector>where Self: Debug,
Unwraps the value, yielding the content of ComplexSelector
.
Panics
Panics if the value is not ComplexSelector
, with a panic message including the content of self
.
sourcepub fn complex_selector(self) -> Option<Box<ComplexSelector>>
pub fn complex_selector(self) -> Option<Box<ComplexSelector>>
Returns Some
if self
is of variant ComplexSelector
, and None
otherwise.
sourcepub const fn is_layer_name(&self) -> bool
pub const fn is_layer_name(&self) -> bool
Returns true
if self
is of variant LayerName
.
sourcepub fn as_layer_name(&self) -> Option<&Box<LayerName>>
pub fn as_layer_name(&self) -> Option<&Box<LayerName>>
Returns Some
if self
is a reference of variant LayerName
, and None
otherwise.
sourcepub fn as_mut_layer_name(&mut self) -> Option<&mut Box<LayerName>>
pub fn as_mut_layer_name(&mut self) -> Option<&mut Box<LayerName>>
Returns Some
if self
is a mutable reference of variant LayerName
, and None
otherwise.
sourcepub fn expect_layer_name(self) -> Box<LayerName>where
Self: Debug,
pub fn expect_layer_name(self) -> Box<LayerName>where Self: Debug,
sourcepub fn layer_name(self) -> Option<Box<LayerName>>
pub fn layer_name(self) -> Option<Box<LayerName>>
Returns Some
if self
is of variant LayerName
, and None
otherwise.
sourcepub const fn is_supports_condition(&self) -> bool
pub const fn is_supports_condition(&self) -> bool
Returns true
if self
is of variant SupportsCondition
.
sourcepub fn as_supports_condition(&self) -> Option<&Box<SupportsCondition>>
pub fn as_supports_condition(&self) -> Option<&Box<SupportsCondition>>
Returns Some
if self
is a reference of variant SupportsCondition
, and None
otherwise.
sourcepub fn as_mut_supports_condition(
&mut self
) -> Option<&mut Box<SupportsCondition>>
pub fn as_mut_supports_condition( &mut self ) -> Option<&mut Box<SupportsCondition>>
Returns Some
if self
is a mutable reference of variant SupportsCondition
, and None
otherwise.
sourcepub fn expect_supports_condition(self) -> Box<SupportsCondition>where
Self: Debug,
pub fn expect_supports_condition(self) -> Box<SupportsCondition>where Self: Debug,
Unwraps the value, yielding the content of SupportsCondition
.
Panics
Panics if the value is not SupportsCondition
, with a panic message including the content of self
.
sourcepub fn supports_condition(self) -> Option<Box<SupportsCondition>>
pub fn supports_condition(self) -> Option<Box<SupportsCondition>>
Returns Some
if self
is of variant SupportsCondition
, and None
otherwise.
sourcepub const fn is_declaration(&self) -> bool
pub const fn is_declaration(&self) -> bool
Returns true
if self
is of variant Declaration
.
sourcepub fn as_declaration(&self) -> Option<&Box<Declaration>>
pub fn as_declaration(&self) -> Option<&Box<Declaration>>
Returns Some
if self
is a reference of variant Declaration
, and None
otherwise.
sourcepub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
pub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
Returns Some
if self
is a mutable reference of variant Declaration
, and None
otherwise.
sourcepub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
pub fn expect_declaration(self) -> Box<Declaration>where Self: Debug,
Unwraps the value, yielding the content of Declaration
.
Panics
Panics if the value is not Declaration
, with a panic message including the content of self
.
sourcepub fn declaration(self) -> Option<Box<Declaration>>
pub fn declaration(self) -> Option<Box<Declaration>>
Returns Some
if self
is of variant Declaration
, and None
otherwise.
sourcepub const fn is_id_selector(&self) -> bool
pub const fn is_id_selector(&self) -> bool
Returns true
if self
is of variant IdSelector
.
sourcepub fn as_id_selector(&self) -> Option<&Box<IdSelector>>
pub fn as_id_selector(&self) -> Option<&Box<IdSelector>>
Returns Some
if self
is a reference of variant IdSelector
, and None
otherwise.
sourcepub fn as_mut_id_selector(&mut self) -> Option<&mut Box<IdSelector>>
pub fn as_mut_id_selector(&mut self) -> Option<&mut Box<IdSelector>>
Returns Some
if self
is a mutable reference of variant IdSelector
, and None
otherwise.
sourcepub fn expect_id_selector(self) -> Box<IdSelector>where
Self: Debug,
pub fn expect_id_selector(self) -> Box<IdSelector>where Self: Debug,
Unwraps the value, yielding the content of IdSelector
.
Panics
Panics if the value is not IdSelector
, with a panic message including the content of self
.
sourcepub fn id_selector(self) -> Option<Box<IdSelector>>
pub fn id_selector(self) -> Option<Box<IdSelector>>
Returns Some
if self
is of variant IdSelector
, and None
otherwise.
Trait Implementations§
source§impl Clone for ComponentValue
impl Clone for ComponentValue
source§fn clone(&self) -> ComponentValue
fn clone(&self) -> ComponentValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ComponentValue
impl Debug for ComponentValue
source§impl EqIgnoreSpan for ComponentValue
impl EqIgnoreSpan for ComponentValue
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Box<AlphaValue, Global>> for ComponentValue
impl From<Box<AlphaValue, Global>> for ComponentValue
source§fn from(v: Box<AlphaValue>) -> Self
fn from(v: Box<AlphaValue>) -> Self
source§impl From<Box<AnglePercentage, Global>> for ComponentValue
impl From<Box<AnglePercentage, Global>> for ComponentValue
source§fn from(v: Box<AnglePercentage>) -> Self
fn from(v: Box<AnglePercentage>) -> Self
source§impl From<Box<CmykComponent, Global>> for ComponentValue
impl From<Box<CmykComponent, Global>> for ComponentValue
source§fn from(v: Box<CmykComponent>) -> Self
fn from(v: Box<CmykComponent>) -> Self
source§impl From<Box<ComplexSelector, Global>> for ComponentValue
impl From<Box<ComplexSelector, Global>> for ComponentValue
source§fn from(v: Box<ComplexSelector>) -> Self
fn from(v: Box<ComplexSelector>) -> Self
source§impl From<Box<DashedIdent, Global>> for ComponentValue
impl From<Box<DashedIdent, Global>> for ComponentValue
source§fn from(v: Box<DashedIdent>) -> Self
fn from(v: Box<DashedIdent>) -> Self
source§impl From<Box<Declaration, Global>> for ComponentValue
impl From<Box<Declaration, Global>> for ComponentValue
source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
source§impl From<Box<FrequencyPercentage, Global>> for ComponentValue
impl From<Box<FrequencyPercentage, Global>> for ComponentValue
source§fn from(v: Box<FrequencyPercentage>) -> Self
fn from(v: Box<FrequencyPercentage>) -> Self
source§impl From<Box<IdSelector, Global>> for ComponentValue
impl From<Box<IdSelector, Global>> for ComponentValue
source§fn from(v: Box<IdSelector>) -> Self
fn from(v: Box<IdSelector>) -> Self
source§impl From<Box<KeyframeBlock, Global>> for ComponentValue
impl From<Box<KeyframeBlock, Global>> for ComponentValue
source§fn from(v: Box<KeyframeBlock>) -> Self
fn from(v: Box<KeyframeBlock>) -> Self
source§impl From<Box<LengthPercentage, Global>> for ComponentValue
impl From<Box<LengthPercentage, Global>> for ComponentValue
source§fn from(v: Box<LengthPercentage>) -> Self
fn from(v: Box<LengthPercentage>) -> Self
source§impl From<Box<ListOfComponentValues, Global>> for ComponentValue
impl From<Box<ListOfComponentValues, Global>> for ComponentValue
source§fn from(v: Box<ListOfComponentValues>) -> Self
fn from(v: Box<ListOfComponentValues>) -> Self
source§impl From<Box<Percentage, Global>> for ComponentValue
impl From<Box<Percentage, Global>> for ComponentValue
source§fn from(v: Box<Percentage>) -> Self
fn from(v: Box<Percentage>) -> Self
source§impl From<Box<QualifiedRule, Global>> for ComponentValue
impl From<Box<QualifiedRule, Global>> for ComponentValue
source§fn from(v: Box<QualifiedRule>) -> Self
fn from(v: Box<QualifiedRule>) -> Self
source§impl From<Box<SimpleBlock, Global>> for ComponentValue
impl From<Box<SimpleBlock, Global>> for ComponentValue
source§fn from(v: Box<SimpleBlock>) -> Self
fn from(v: Box<SimpleBlock>) -> Self
source§impl From<Box<SupportsCondition, Global>> for ComponentValue
impl From<Box<SupportsCondition, Global>> for ComponentValue
source§fn from(v: Box<SupportsCondition>) -> Self
fn from(v: Box<SupportsCondition>) -> Self
source§impl From<Box<TimePercentage, Global>> for ComponentValue
impl From<Box<TimePercentage, Global>> for ComponentValue
source§fn from(v: Box<TimePercentage>) -> Self
fn from(v: Box<TimePercentage>) -> Self
source§impl From<Box<TokenAndSpan, Global>> for ComponentValue
impl From<Box<TokenAndSpan, Global>> for ComponentValue
source§fn from(v: Box<TokenAndSpan>) -> Self
fn from(v: Box<TokenAndSpan>) -> Self
source§impl From<Box<UnicodeRange, Global>> for ComponentValue
impl From<Box<UnicodeRange, Global>> for ComponentValue
source§fn from(v: Box<UnicodeRange>) -> Self
fn from(v: Box<UnicodeRange>) -> Self
source§impl From<DeclarationOrAtRule> for ComponentValue
impl From<DeclarationOrAtRule> for ComponentValue
source§fn from(rule: DeclarationOrAtRule) -> Self
fn from(rule: DeclarationOrAtRule) -> Self
source§impl From<Rule> for ComponentValue
impl From<Rule> for ComponentValue
source§impl From<StyleBlock> for ComponentValue
impl From<StyleBlock> for ComponentValue
source§fn from(block: StyleBlock) -> Self
fn from(block: StyleBlock) -> Self
source§impl Hash for ComponentValue
impl Hash for ComponentValue
source§impl PartialEq<ComponentValue> for ComponentValue
impl PartialEq<ComponentValue> for ComponentValue
source§fn eq(&self, other: &ComponentValue) -> bool
fn eq(&self, other: &ComponentValue) -> bool
self
and other
values to be equal, and is used
by ==
.