Enum swc_css_ast::CmykComponent
source · pub enum CmykComponent {
Number(Number),
Percentage(Percentage),
Function(Function),
}Variants§
Implementations§
source§impl CmykComponent
impl CmykComponent
sourcepub fn as_number(&self) -> Option<&Number>
pub fn as_number(&self) -> Option<&Number>
Returns Some if self is a reference of variant Number, and None otherwise.
sourcepub fn as_mut_number(&mut self) -> Option<&mut Number>
pub fn as_mut_number(&mut self) -> Option<&mut Number>
Returns Some if self is a mutable reference of variant Number, and None otherwise.
sourcepub fn expect_number(self) -> Numberwhere
Self: Debug,
pub fn expect_number(self) -> Numberwhere
Self: Debug,
sourcepub fn number(self) -> Option<Number>
pub fn number(self) -> Option<Number>
Returns Some if self is of variant Number, and None otherwise.
sourcepub const fn is_percentage(&self) -> bool
pub const fn is_percentage(&self) -> bool
Returns true if self is of variant Percentage.
sourcepub fn as_percentage(&self) -> Option<&Percentage>
pub fn as_percentage(&self) -> Option<&Percentage>
Returns Some if self is a reference of variant Percentage, and None otherwise.
sourcepub fn as_mut_percentage(&mut self) -> Option<&mut Percentage>
pub fn as_mut_percentage(&mut self) -> Option<&mut Percentage>
Returns Some if self is a mutable reference of variant Percentage, and None otherwise.
sourcepub fn expect_percentage(self) -> Percentagewhere
Self: Debug,
pub fn expect_percentage(self) -> Percentagewhere
Self: Debug,
Unwraps the value, yielding the content of Percentage.
Panics
Panics if the value is not Percentage, with a panic message including the content of self.
sourcepub fn percentage(self) -> Option<Percentage>
pub fn percentage(self) -> Option<Percentage>
Returns Some if self is of variant Percentage, 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 CmykComponent
impl Clone for CmykComponent
source§fn clone(&self) -> CmykComponent
fn clone(&self) -> CmykComponent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CmykComponent
impl Debug for CmykComponent
source§impl EqIgnoreSpan for CmykComponent
impl EqIgnoreSpan for CmykComponent
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Function> for CmykComponent
impl From<Function> for CmykComponent
source§impl From<Number> for CmykComponent
impl From<Number> for CmykComponent
source§impl From<Percentage> for CmykComponent
impl From<Percentage> for CmykComponent
source§fn from(v: Percentage) -> Self
fn from(v: Percentage) -> Self
source§impl Hash for CmykComponent
impl Hash for CmykComponent
source§impl PartialEq for CmykComponent
impl PartialEq for CmykComponent
source§fn eq(&self, other: &CmykComponent) -> bool
fn eq(&self, other: &CmykComponent) -> bool
self and other values to be equal, and is used
by ==.