Enum swc_css_ast::Color
source · pub enum Color {
AbsoluteColorBase(AbsoluteColorBase),
CurrentColorOrSystemColor(Ident),
Function(Function),
}
Variants§
Implementations§
source§impl Color
impl Color
sourcepub fn is_absolute_color_base(&self) -> bool
pub 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 fn is_current_color_or_system_color(&self) -> bool
pub 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 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 Archive for Color
impl Archive for Color
§type Archived = ArchivedColor
type Archived = ArchivedColor
§type Resolver = ColorResolver
type Resolver = ColorResolver
source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
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<__D> Deserialize<Color, __D> for Archived<Color>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
impl<__D> Deserialize<Color, __D> for Archived<Color>where __D: SharedDeserializeRegistry + Fallible + ?Sized,
source§impl EqIgnoreSpan for Color
impl EqIgnoreSpan for Color
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 PartialEq<Color> for Color
impl PartialEq<Color> for Color
source§impl<__S> Serialize<__S> for Colorwhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
impl<__S> Serialize<__S> for Colorwhere __S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
impl Eq for Color
impl StructuralEq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
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> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
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.