Enum swc_css_ast::AbsoluteColorBase
source · [−]pub enum AbsoluteColorBase {
HexColor(HexColor),
NamedColorOrTransparent(Ident),
Function(Function),
}
Variants
HexColor(HexColor)
NamedColorOrTransparent(Ident)
Function(Function)
Implementations
sourceimpl AbsoluteColorBase
impl AbsoluteColorBase
sourcepub fn is_hex_color(&self) -> bool
pub fn is_hex_color(&self) -> bool
Returns true
if self
is of variant HexColor
.
sourcepub fn as_hex_color(&self) -> Option<&HexColor>
pub fn as_hex_color(&self) -> Option<&HexColor>
Returns Some
if self
is a reference of variant HexColor
, and None
otherwise.
sourcepub fn as_mut_hex_color(&mut self) -> Option<&mut HexColor>
pub fn as_mut_hex_color(&mut self) -> Option<&mut HexColor>
Returns Some
if self
is a mutable reference of variant HexColor
, and None
otherwise.
sourcepub fn expect_hex_color(self) -> HexColorwhere
Self: Debug,
pub fn expect_hex_color(self) -> HexColorwhere
Self: Debug,
sourcepub fn hex_color(self) -> Option<HexColor>
pub fn hex_color(self) -> Option<HexColor>
Returns Some
if self
is of variant HexColor
, and None
otherwise.
sourcepub fn is_named_color_or_transparent(&self) -> bool
pub fn is_named_color_or_transparent(&self) -> bool
Returns true
if self
is of variant NamedColorOrTransparent
.
sourcepub fn as_named_color_or_transparent(&self) -> Option<&Ident>
pub fn as_named_color_or_transparent(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant NamedColorOrTransparent
, and None
otherwise.
sourcepub fn as_mut_named_color_or_transparent(&mut self) -> Option<&mut Ident>
pub fn as_mut_named_color_or_transparent(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant NamedColorOrTransparent
, and None
otherwise.
sourcepub fn expect_named_color_or_transparent(self) -> Identwhere
Self: Debug,
pub fn expect_named_color_or_transparent(self) -> Identwhere
Self: Debug,
Unwraps the value, yielding the content of NamedColorOrTransparent
.
Panics
Panics if the value is not NamedColorOrTransparent
, with a panic message including the content of self
.
sourcepub fn named_color_or_transparent(self) -> Option<Ident>
pub fn named_color_or_transparent(self) -> Option<Ident>
Returns Some
if self
is of variant NamedColorOrTransparent
, and None
otherwise.
sourcepub fn is_function(&self) -> bool
pub 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.
sourcepub fn expect_function(self) -> Functionwhere
Self: Debug,
pub fn expect_function(self) -> Functionwhere
Self: Debug,
Trait Implementations
sourceimpl Clone for AbsoluteColorBase
impl Clone for AbsoluteColorBase
sourcefn clone(&self) -> AbsoluteColorBase
fn clone(&self) -> AbsoluteColorBase
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more