Enum swc_css_ast::AbsoluteColorBase
source · pub enum AbsoluteColorBase {
HexColor(HexColor),
NamedColorOrTransparent(Ident),
Function(Function),
}
Variants§
Implementations§
source§impl 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§
source§impl Clone for AbsoluteColorBase
impl Clone for AbsoluteColorBase
source§fn clone(&self) -> AbsoluteColorBase
fn clone(&self) -> AbsoluteColorBase
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AbsoluteColorBase
impl Debug for AbsoluteColorBase
source§impl<'de> Deserialize<'de> for AbsoluteColorBase
impl<'de> Deserialize<'de> for AbsoluteColorBase
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl EqIgnoreSpan for AbsoluteColorBase
impl EqIgnoreSpan for AbsoluteColorBase
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<AbsoluteColorBase> for Color
impl From<AbsoluteColorBase> for Color
source§fn from(v: AbsoluteColorBase) -> Self
fn from(v: AbsoluteColorBase) -> Self
source§impl From<Function> for AbsoluteColorBase
impl From<Function> for AbsoluteColorBase
source§impl From<HexColor> for AbsoluteColorBase
impl From<HexColor> for AbsoluteColorBase
source§impl From<Ident> for AbsoluteColorBase
impl From<Ident> for AbsoluteColorBase
source§impl Hash for AbsoluteColorBase
impl Hash for AbsoluteColorBase
source§impl PartialEq<AbsoluteColorBase> for AbsoluteColorBase
impl PartialEq<AbsoluteColorBase> for AbsoluteColorBase
source§fn eq(&self, other: &AbsoluteColorBase) -> bool
fn eq(&self, other: &AbsoluteColorBase) -> bool
self
and other
values to be equal, and is used
by ==
.