Enum swc_css_ast::AbsoluteColorBase
source · pub enum AbsoluteColorBase {
HexColor(HexColor),
NamedColorOrTransparent(Ident),
Function(Function),
}
Variants§
Implementations§
source§impl AbsoluteColorBase
impl AbsoluteColorBase
sourcepub const fn is_hex_color(&self) -> bool
pub const 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 const fn is_named_color_or_transparent(&self) -> bool
pub const 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 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.
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 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 for AbsoluteColorBase
impl PartialEq 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 ==
.source§impl Spanned for AbsoluteColorBase
impl Spanned for AbsoluteColorBase
impl Eq for AbsoluteColorBase
impl StructuralEq for AbsoluteColorBase
impl StructuralPartialEq for AbsoluteColorBase
Auto Trait Implementations§
impl RefUnwindSafe for AbsoluteColorBase
impl Send for AbsoluteColorBase
impl Sync for AbsoluteColorBase
impl Unpin for AbsoluteColorBase
impl UnwindSafe for AbsoluteColorBase
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.