Enum swc_css_ast::StyleBlock
source · pub enum StyleBlock {
AtRule(Box<AtRule>),
Declaration(Box<Declaration>),
QualifiedRule(Box<QualifiedRule>),
ListOfComponentValues(Box<ListOfComponentValues>),
}
Variants§
AtRule(Box<AtRule>)
Declaration(Box<Declaration>)
QualifiedRule(Box<QualifiedRule>)
ListOfComponentValues(Box<ListOfComponentValues>)
Implementations§
source§impl StyleBlock
impl StyleBlock
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_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_qualified_rule(&self) -> bool
pub fn is_qualified_rule(&self) -> bool
Returns true
if self
is of variant QualifiedRule
.
sourcepub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
pub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
Returns Some
if self
is a reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
pub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
Returns Some
if self
is a mutable reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn expect_qualified_rule(self) -> Box<QualifiedRule>where
Self: Debug,
pub fn expect_qualified_rule(self) -> Box<QualifiedRule>where Self: Debug,
Unwraps the value, yielding the content of QualifiedRule
.
Panics
Panics if the value is not QualifiedRule
, with a panic message including the content of self
.
sourcepub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
pub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
Returns Some
if self
is of variant QualifiedRule
, 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 StyleBlock
impl Archive for StyleBlock
§type Archived = ArchivedStyleBlock
type Archived = ArchivedStyleBlock
§type Resolver = StyleBlockResolver
type Resolver = StyleBlockResolver
source§impl Clone for StyleBlock
impl Clone for StyleBlock
source§fn clone(&self) -> StyleBlock
fn clone(&self) -> StyleBlock
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StyleBlock
impl Debug for StyleBlock
source§impl<'de> Deserialize<'de> for StyleBlock
impl<'de> Deserialize<'de> for StyleBlock
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<StyleBlock, __D> for Archived<StyleBlock>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
impl<__D> Deserialize<StyleBlock, __D> for Archived<StyleBlock>where __D: SharedDeserializeRegistry + Fallible + ?Sized,
source§fn deserialize(&self, deserializer: &mut __D) -> Result<StyleBlock, __D::Error>
fn deserialize(&self, deserializer: &mut __D) -> Result<StyleBlock, __D::Error>
source§impl EqIgnoreSpan for StyleBlock
impl EqIgnoreSpan for StyleBlock
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Box<Declaration, Global>> for StyleBlock
impl From<Box<Declaration, Global>> for StyleBlock
source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
source§impl From<Box<ListOfComponentValues, Global>> for StyleBlock
impl From<Box<ListOfComponentValues, Global>> for StyleBlock
source§fn from(v: Box<ListOfComponentValues>) -> Self
fn from(v: Box<ListOfComponentValues>) -> Self
source§impl From<Box<QualifiedRule, Global>> for StyleBlock
impl From<Box<QualifiedRule, Global>> for StyleBlock
source§fn from(v: Box<QualifiedRule>) -> Self
fn from(v: Box<QualifiedRule>) -> Self
source§impl From<StyleBlock> for ComponentValue
impl From<StyleBlock> for ComponentValue
source§fn from(block: StyleBlock) -> Self
fn from(block: StyleBlock) -> Self
source§impl Hash for StyleBlock
impl Hash for StyleBlock
source§impl PartialEq<StyleBlock> for StyleBlock
impl PartialEq<StyleBlock> for StyleBlock
source§fn eq(&self, other: &StyleBlock) -> bool
fn eq(&self, other: &StyleBlock) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<__S> Serialize<__S> for StyleBlockwhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
impl<__S> Serialize<__S> for StyleBlockwhere __S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
source§impl Serialize for StyleBlock
impl Serialize for StyleBlock
source§impl Spanned for StyleBlock
impl Spanned for StyleBlock
impl Eq for StyleBlock
impl StructuralEq for StyleBlock
impl StructuralPartialEq for StyleBlock
Auto Trait Implementations§
impl RefUnwindSafe for StyleBlock
impl Send for StyleBlock
impl Sync for StyleBlock
impl Unpin for StyleBlock
impl UnwindSafe for StyleBlock
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.