Enum swc_css_ast::CalcValueOrOperator
source · [−]pub enum CalcValueOrOperator {
Value(CalcValue),
Operator(CalcOperator),
}
Variants
Value(CalcValue)
Operator(CalcOperator)
Implementations
sourceimpl 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
sourceimpl Clone for CalcValueOrOperator
impl Clone for CalcValueOrOperator
sourcefn clone(&self) -> CalcValueOrOperator
fn clone(&self) -> CalcValueOrOperator
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 moresourceimpl Debug for CalcValueOrOperator
impl Debug for CalcValueOrOperator
sourceimpl<'de> Deserialize<'de> for CalcValueOrOperator
impl<'de> Deserialize<'de> for CalcValueOrOperator
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 CalcValueOrOperator
impl EqIgnoreSpan for CalcValueOrOperator
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<CalcOperator> for CalcValueOrOperator
impl From<CalcOperator> for CalcValueOrOperator
sourcefn from(v: CalcOperator) -> Self
fn from(v: CalcOperator) -> Self
Converts to this type from the input type.
sourceimpl From<CalcValue> for CalcValueOrOperator
impl From<CalcValue> for CalcValueOrOperator
sourceimpl Hash for CalcValueOrOperator
impl Hash for CalcValueOrOperator
sourceimpl PartialEq<CalcValueOrOperator> for CalcValueOrOperator
impl PartialEq<CalcValueOrOperator> for CalcValueOrOperator
sourcefn eq(&self, other: &CalcValueOrOperator) -> bool
fn eq(&self, other: &CalcValueOrOperator) -> bool
sourceimpl Serialize for CalcValueOrOperator
impl Serialize for CalcValueOrOperator
sourceimpl Spanned for CalcValueOrOperator
impl Spanned for CalcValueOrOperator
impl Eq for CalcValueOrOperator
impl StructuralEq for CalcValueOrOperator
impl StructuralPartialEq for CalcValueOrOperator
Auto Trait Implementations
impl RefUnwindSafe for CalcValueOrOperator
impl Send for CalcValueOrOperator
impl Sync for CalcValueOrOperator
impl Unpin for CalcValueOrOperator
impl UnwindSafe for CalcValueOrOperator
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