Enum swc_css_ast::Color
source · pub enum Color {
AbsoluteColorBase(AbsoluteColorBase),
CurrentColorOrSystemColor(Ident),
Function(Function),
}Variants§
Implementations§
source§impl Color
impl Color
sourcepub const fn is_absolute_color_base(&self) -> bool
pub const fn is_absolute_color_base(&self) -> bool
Returns true if self is of variant AbsoluteColorBase.
sourcepub fn as_absolute_color_base(&self) -> Option<&AbsoluteColorBase>
pub fn as_absolute_color_base(&self) -> Option<&AbsoluteColorBase>
Returns Some if self is a reference of variant AbsoluteColorBase, and None otherwise.
sourcepub fn as_mut_absolute_color_base(&mut self) -> Option<&mut AbsoluteColorBase>
pub fn as_mut_absolute_color_base(&mut self) -> Option<&mut AbsoluteColorBase>
Returns Some if self is a mutable reference of variant AbsoluteColorBase, and None otherwise.
sourcepub fn expect_absolute_color_base(self) -> AbsoluteColorBasewhere
Self: Debug,
pub fn expect_absolute_color_base(self) -> AbsoluteColorBasewhere
Self: Debug,
Unwraps the value, yielding the content of AbsoluteColorBase.
Panics
Panics if the value is not AbsoluteColorBase, with a panic message including the content of self.
sourcepub fn absolute_color_base(self) -> Option<AbsoluteColorBase>
pub fn absolute_color_base(self) -> Option<AbsoluteColorBase>
Returns Some if self is of variant AbsoluteColorBase, and None otherwise.
sourcepub const fn is_current_color_or_system_color(&self) -> bool
pub const fn is_current_color_or_system_color(&self) -> bool
Returns true if self is of variant CurrentColorOrSystemColor.
sourcepub fn as_current_color_or_system_color(&self) -> Option<&Ident>
pub fn as_current_color_or_system_color(&self) -> Option<&Ident>
Returns Some if self is a reference of variant CurrentColorOrSystemColor, and None otherwise.
sourcepub fn as_mut_current_color_or_system_color(&mut self) -> Option<&mut Ident>
pub fn as_mut_current_color_or_system_color(&mut self) -> Option<&mut Ident>
Returns Some if self is a mutable reference of variant CurrentColorOrSystemColor, and None otherwise.
sourcepub fn expect_current_color_or_system_color(self) -> Identwhere
Self: Debug,
pub fn expect_current_color_or_system_color(self) -> Identwhere
Self: Debug,
Unwraps the value, yielding the content of CurrentColorOrSystemColor.
Panics
Panics if the value is not CurrentColorOrSystemColor, with a panic message including the content of self.
sourcepub fn current_color_or_system_color(self) -> Option<Ident>
pub fn current_color_or_system_color(self) -> Option<Ident>
Returns Some if self is of variant CurrentColorOrSystemColor, 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<&Function>
pub fn as_function(&self) -> Option<&Function>
Returns Some if self is a reference of variant Function, and None otherwise.
sourcepub fn as_mut_function(&mut self) -> Option<&mut Function>
pub fn as_mut_function(&mut self) -> Option<&mut Function>
Returns Some if self is a mutable reference of variant Function, and None otherwise.