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 expect_value(self) -> CalcValue where
Self: Debug,
pub fn expect_value(self) -> CalcValue where
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 expect_operator(self) -> CalcOperator where
Self: Debug,
pub fn expect_operator(self) -> CalcOperator where
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 more
sourceimpl 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CalcValueOrOperator) -> bool
fn ne(&self, other: &CalcValueOrOperator) -> bool
This method tests for !=
.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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