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 fn is_declaration(&self) -> bool
pub 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 fn is_at_rule(&self) -> bool
pub 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 fn is_list_of_component_values(&self) -> bool
pub 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 Archive for DeclarationOrAtRule
impl Archive for DeclarationOrAtRule
§type Archived = ArchivedDeclarationOrAtRule
type Archived = ArchivedDeclarationOrAtRule
§type Resolver = DeclarationOrAtRuleResolver
type Resolver = DeclarationOrAtRuleResolver
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<'de> Deserialize<'de> for DeclarationOrAtRule
impl<'de> Deserialize<'de> for DeclarationOrAtRule
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>,
source§impl<__D> Deserialize<DeclarationOrAtRule, __D> for Archived<DeclarationOrAtRule>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
impl<__D> Deserialize<DeclarationOrAtRule, __D> for Archived<DeclarationOrAtRule>where __D: SharedDeserializeRegistry + Fallible + ?Sized,
source§fn deserialize(
&self,
deserializer: &mut __D
) -> Result<DeclarationOrAtRule, __D::Error>
fn deserialize( &self, deserializer: &mut __D ) -> Result<DeclarationOrAtRule, __D::Error>
source§impl EqIgnoreSpan for DeclarationOrAtRule
impl EqIgnoreSpan for DeclarationOrAtRule
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Box<Declaration, Global>> for DeclarationOrAtRule
impl From<Box<Declaration, Global>> for DeclarationOrAtRule
source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
source§impl From<Box<ListOfComponentValues, Global>> for DeclarationOrAtRule
impl From<Box<ListOfComponentValues, Global>> 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<DeclarationOrAtRule> for DeclarationOrAtRule
impl PartialEq<DeclarationOrAtRule> for DeclarationOrAtRule
source§fn eq(&self, other: &DeclarationOrAtRule) -> bool
fn eq(&self, other: &DeclarationOrAtRule) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<__S> Serialize<__S> for DeclarationOrAtRulewhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
impl<__S> Serialize<__S> for DeclarationOrAtRulewhere __S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
source§impl Serialize for DeclarationOrAtRule
impl Serialize for DeclarationOrAtRule
source§impl Spanned for DeclarationOrAtRule
impl Spanned for DeclarationOrAtRule
impl Eq for DeclarationOrAtRule
impl StructuralEq for DeclarationOrAtRule
impl StructuralPartialEq for DeclarationOrAtRule
Auto Trait Implementations§
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> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.