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 const fn is_operator(&self) -> bool
pub const 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 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 for CalcValueOrOperator
impl PartialEq 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 ==
.source§impl Spanned for CalcValueOrOperator
impl Spanned for CalcValueOrOperator
impl Eq for CalcValueOrOperator
impl StructuralPartialEq for CalcValueOrOperator
Auto Trait Implementations§
impl Freeze for CalcValueOrOperator
impl RefUnwindSafe for CalcValueOrOperator
impl Send for CalcValueOrOperator
impl Sync for CalcValueOrOperator
impl Unpin for CalcValueOrOperator
impl UnwindSafe for CalcValueOrOperator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more