Enum swc_css_ast::Color
source · [−]pub enum Color {
AbsoluteColorBase(AbsoluteColorBase),
CurrentColorOrSystemColor(Ident),
Function(Function),
}
Variants
AbsoluteColorBase(AbsoluteColorBase)
CurrentColorOrSystemColor(Ident)
Function(Function)
Implementations
sourceimpl 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 expect_absolute_color_base(self) -> AbsoluteColorBase where
Self: Debug,
pub fn expect_absolute_color_base(self) -> AbsoluteColorBase where
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 expect_current_color_or_system_color(self) -> Ident where
Self: Debug,
pub fn expect_current_color_or_system_color(self) -> Ident where
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 expect_function(self) -> Function where
Self: Debug,
pub fn expect_function(self) -> Function where
Self: Debug,
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for Color
impl EqIgnoreSpan for Color
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<AbsoluteColorBase> for Color
impl From<AbsoluteColorBase> for Color
sourcefn from(v: AbsoluteColorBase) -> Self
fn from(v: AbsoluteColorBase) -> Self
Converts to this type from the input type.
sourceimpl From<Color> for ComponentValue
impl From<Color> for ComponentValue
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more