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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AbsoluteColorBase
impl Debug for AbsoluteColorBase
sourceimpl<'de> Deserialize<'de> for AbsoluteColorBase
impl<'de> Deserialize<'de> for AbsoluteColorBase
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 AbsoluteColorBase
impl EqIgnoreSpan for AbsoluteColorBase
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<Function> for AbsoluteColorBase
impl From<Function> for AbsoluteColorBase
sourceimpl From<HexColor> for AbsoluteColorBase
impl From<HexColor> for AbsoluteColorBase
sourceimpl From<Ident> for AbsoluteColorBase
impl From<Ident> for AbsoluteColorBase
sourceimpl Hash for AbsoluteColorBase
impl Hash for AbsoluteColorBase
sourceimpl PartialEq<AbsoluteColorBase> for AbsoluteColorBase
impl PartialEq<AbsoluteColorBase> for AbsoluteColorBase
sourcefn eq(&self, other: &AbsoluteColorBase) -> bool
fn eq(&self, other: &AbsoluteColorBase) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl Serialize for AbsoluteColorBase
impl Serialize for AbsoluteColorBase
sourceimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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> 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