Enum swc_css_ast::DeclarationOrAtRule
source · pub enum DeclarationOrAtRule {
Declaration(Box<Declaration>),
AtRule(Box<AtRule>),
ListOfComponentValues(Box<ListOfComponentValues>),
}
Variants§
Declaration(Box<Declaration>)
AtRule(Box<AtRule>)
ListOfComponentValues(Box<ListOfComponentValues>)
Implementations§
source§impl DeclarationOrAtRule
impl DeclarationOrAtRule
sourcepub const fn is_declaration(&self) -> bool
pub const fn is_declaration(&self) -> bool
Returns true
if self
is of variant Declaration
.
sourcepub fn as_declaration(&self) -> Option<&Box<Declaration>>
pub fn as_declaration(&self) -> Option<&Box<Declaration>>
Returns Some
if self
is a reference of variant Declaration
, and None
otherwise.
sourcepub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
pub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
Returns Some
if self
is a mutable reference of variant Declaration
, and None
otherwise.
sourcepub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
pub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
Unwraps the value, yielding the content of Declaration
.
§Panics
Panics if the value is not Declaration
, with a panic message including the content of self
.
sourcepub fn declaration(self) -> Option<Box<Declaration>>
pub fn declaration(self) -> Option<Box<Declaration>>
Returns Some
if self
is of variant Declaration
, and None
otherwise.
sourcepub const fn is_at_rule(&self) -> bool
pub const fn is_at_rule(&self) -> bool
Returns true
if self
is of variant AtRule
.
sourcepub fn as_at_rule(&self) -> Option<&Box<AtRule>>
pub fn as_at_rule(&self) -> Option<&Box<AtRule>>
Returns Some
if self
is a reference of variant AtRule
, and None
otherwise.
sourcepub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
pub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
Returns Some
if self
is a mutable reference of variant AtRule
, and None
otherwise.
sourcepub fn expect_at_rule(self) -> Box<AtRule>where
Self: Debug,
pub fn expect_at_rule(self) -> Box<AtRule>where
Self: Debug,
sourcepub fn at_rule(self) -> Option<Box<AtRule>>
pub fn at_rule(self) -> Option<Box<AtRule>>
Returns Some
if self
is of variant AtRule
, and None
otherwise.
sourcepub const fn is_list_of_component_values(&self) -> bool
pub const fn is_list_of_component_values(&self) -> bool
Returns true
if self
is of variant ListOfComponentValues
.
sourcepub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
pub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
Returns Some
if self
is a reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn as_mut_list_of_component_values(
&mut self,
) -> Option<&mut Box<ListOfComponentValues>>
pub fn as_mut_list_of_component_values( &mut self, ) -> Option<&mut Box<ListOfComponentValues>>
Returns Some
if self
is a mutable reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where
Self: Debug,
pub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where
Self: Debug,
Unwraps the value, yielding the content of ListOfComponentValues
.
§Panics
Panics if the value is not ListOfComponentValues
, with a panic message including the content of self
.
sourcepub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
pub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
Returns Some
if self
is of variant ListOfComponentValues
, and None
otherwise.
Trait Implementations§
source§impl Clone for DeclarationOrAtRule
impl Clone for DeclarationOrAtRule
source§fn clone(&self) -> DeclarationOrAtRule
fn clone(&self) -> DeclarationOrAtRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeclarationOrAtRule
impl Debug for DeclarationOrAtRule
source§impl EqIgnoreSpan for DeclarationOrAtRule
impl EqIgnoreSpan for DeclarationOrAtRule
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Box<Declaration>> for DeclarationOrAtRule
impl From<Box<Declaration>> for DeclarationOrAtRule
source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
source§impl From<Box<ListOfComponentValues>> for DeclarationOrAtRule
impl From<Box<ListOfComponentValues>> for DeclarationOrAtRule
source§fn from(v: Box<ListOfComponentValues>) -> Self
fn from(v: Box<ListOfComponentValues>) -> Self
source§impl From<DeclarationOrAtRule> for ComponentValue
impl From<DeclarationOrAtRule> for ComponentValue
source§fn from(rule: DeclarationOrAtRule) -> Self
fn from(rule: DeclarationOrAtRule) -> Self
source§impl Hash for DeclarationOrAtRule
impl Hash for DeclarationOrAtRule
source§impl PartialEq for DeclarationOrAtRule
impl PartialEq for DeclarationOrAtRule
source§impl Spanned for DeclarationOrAtRule
impl Spanned for DeclarationOrAtRule
impl Eq for DeclarationOrAtRule
impl StructuralPartialEq for DeclarationOrAtRule
Auto Trait Implementations§
impl Freeze for DeclarationOrAtRule
impl RefUnwindSafe for DeclarationOrAtRule
impl Send for DeclarationOrAtRule
impl Sync for DeclarationOrAtRule
impl Unpin for DeclarationOrAtRule
impl UnwindSafe for DeclarationOrAtRule
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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>
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