Enum swc_css_ast::CalcValueOrOperator
source · pub enum CalcValueOrOperator {
Value(CalcValue),
Operator(CalcOperator),
}
Variants§
Value(CalcValue)
Operator(CalcOperator)
Implementations§
source§impl CalcValueOrOperator
impl CalcValueOrOperator
sourcepub fn as_value(&self) -> Option<&CalcValue>
pub fn as_value(&self) -> Option<&CalcValue>
Returns Some
if self
is a reference of variant Value
, and None
otherwise.
sourcepub fn as_mut_value(&mut self) -> Option<&mut CalcValue>
pub fn as_mut_value(&mut self) -> Option<&mut CalcValue>
Returns Some
if self
is a mutable reference of variant Value
, and None
otherwise.
sourcepub fn expect_value(self) -> CalcValuewhere
Self: Debug,
pub fn expect_value(self) -> CalcValuewhere
Self: Debug,
sourcepub fn value(self) -> Option<CalcValue>
pub fn value(self) -> Option<CalcValue>
Returns Some
if self
is of variant Value
, and None
otherwise.
sourcepub fn is_operator(&self) -> bool
pub fn is_operator(&self) -> bool
Returns true
if self
is of variant Operator
.
sourcepub fn as_operator(&self) -> Option<&CalcOperator>
pub fn as_operator(&self) -> Option<&CalcOperator>
Returns Some
if self
is a reference of variant Operator
, and None
otherwise.
sourcepub fn as_mut_operator(&mut self) -> Option<&mut CalcOperator>
pub fn as_mut_operator(&mut self) -> Option<&mut CalcOperator>
Returns Some
if self
is a mutable reference of variant Operator
, and None
otherwise.
sourcepub fn expect_operator(self) -> CalcOperatorwhere
Self: Debug,
pub fn expect_operator(self) -> CalcOperatorwhere
Self: Debug,
sourcepub fn operator(self) -> Option<CalcOperator>
pub fn operator(self) -> Option<CalcOperator>
Returns Some
if self
is of variant Operator
, and None
otherwise.
Trait Implementations§
source§impl Clone for CalcValueOrOperator
impl Clone for CalcValueOrOperator
source§fn clone(&self) -> CalcValueOrOperator
fn clone(&self) -> CalcValueOrOperator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CalcValueOrOperator
impl Debug for CalcValueOrOperator
source§impl<'de> Deserialize<'de> for CalcValueOrOperator
impl<'de> Deserialize<'de> for CalcValueOrOperator
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EqIgnoreSpan for CalcValueOrOperator
impl EqIgnoreSpan for CalcValueOrOperator
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<CalcOperator> for CalcValueOrOperator
impl From<CalcOperator> for CalcValueOrOperator
source§fn from(v: CalcOperator) -> Self
fn from(v: CalcOperator) -> Self
Converts to this type from the input type.
source§impl From<CalcValue> for CalcValueOrOperator
impl From<CalcValue> for CalcValueOrOperator
source§impl Hash for CalcValueOrOperator
impl Hash for CalcValueOrOperator
source§impl PartialEq<CalcValueOrOperator> for CalcValueOrOperator
impl PartialEq<CalcValueOrOperator> for CalcValueOrOperator
source§fn eq(&self, other: &CalcValueOrOperator) -> bool
fn eq(&self, other: &CalcValueOrOperator) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.