Enum swc_css_ast::AtRule
source · [−]pub enum AtRule {
Show 17 variants
Charset(CharsetRule),
Import(ImportRule),
FontFace(FontFaceRule),
Keyframes(KeyframesRule),
Layer(LayerRule),
Media(MediaRule),
Supports(SupportsRule),
Page(PageRule),
PageMargin(PageMarginRule),
Namespace(NamespaceRule),
Nest(NestRule),
Viewport(ViewportRule),
Document(DocumentRule),
ColorProfile(ColorProfileRule),
CounterStyle(CounterStyleRule),
Property(PropertyRule),
Unknown(UnknownAtRule),
}
Variants
Charset(CharsetRule)
Import(ImportRule)
FontFace(FontFaceRule)
Keyframes(KeyframesRule)
Layer(LayerRule)
Media(MediaRule)
Supports(SupportsRule)
Page(PageRule)
PageMargin(PageMarginRule)
Namespace(NamespaceRule)
Nest(NestRule)
Viewport(ViewportRule)
Document(DocumentRule)
ColorProfile(ColorProfileRule)
CounterStyle(CounterStyleRule)
Property(PropertyRule)
Unknown(UnknownAtRule)
Implementations
sourceimpl AtRule
impl AtRule
sourcepub fn is_charset(&self) -> bool
pub fn is_charset(&self) -> bool
Returns true
if self
is of variant Charset
.
sourcepub fn as_charset(&self) -> Option<&CharsetRule>
pub fn as_charset(&self) -> Option<&CharsetRule>
Returns Some
if self
is a reference of variant Charset
, and None
otherwise.
sourcepub fn expect_charset(self) -> CharsetRule where
Self: Debug,
pub fn expect_charset(self) -> CharsetRule where
Self: Debug,
sourcepub fn charset(self) -> Option<CharsetRule>
pub fn charset(self) -> Option<CharsetRule>
Returns Some
if self
is of variant Charset
, and None
otherwise.
sourcepub fn as_import(&self) -> Option<&ImportRule>
pub fn as_import(&self) -> Option<&ImportRule>
Returns Some
if self
is a reference of variant Import
, and None
otherwise.
sourcepub fn expect_import(self) -> ImportRule where
Self: Debug,
pub fn expect_import(self) -> ImportRule where
Self: Debug,
sourcepub fn import(self) -> Option<ImportRule>
pub fn import(self) -> Option<ImportRule>
Returns Some
if self
is of variant Import
, and None
otherwise.
sourcepub fn is_font_face(&self) -> bool
pub fn is_font_face(&self) -> bool
Returns true
if self
is of variant FontFace
.
sourcepub fn as_font_face(&self) -> Option<&FontFaceRule>
pub fn as_font_face(&self) -> Option<&FontFaceRule>
Returns Some
if self
is a reference of variant FontFace
, and None
otherwise.
sourcepub fn expect_font_face(self) -> FontFaceRule where
Self: Debug,
pub fn expect_font_face(self) -> FontFaceRule where
Self: Debug,
sourcepub fn font_face(self) -> Option<FontFaceRule>
pub fn font_face(self) -> Option<FontFaceRule>
Returns Some
if self
is of variant FontFace
, and None
otherwise.
sourcepub fn is_keyframes(&self) -> bool
pub fn is_keyframes(&self) -> bool
Returns true
if self
is of variant Keyframes
.
sourcepub fn as_keyframes(&self) -> Option<&KeyframesRule>
pub fn as_keyframes(&self) -> Option<&KeyframesRule>
Returns Some
if self
is a reference of variant Keyframes
, and None
otherwise.
sourcepub fn expect_keyframes(self) -> KeyframesRule where
Self: Debug,
pub fn expect_keyframes(self) -> KeyframesRule where
Self: Debug,
sourcepub fn keyframes(self) -> Option<KeyframesRule>
pub fn keyframes(self) -> Option<KeyframesRule>
Returns Some
if self
is of variant Keyframes
, and None
otherwise.
sourcepub fn as_layer(&self) -> Option<&LayerRule>
pub fn as_layer(&self) -> Option<&LayerRule>
Returns Some
if self
is a reference of variant Layer
, and None
otherwise.
sourcepub fn expect_layer(self) -> LayerRule where
Self: Debug,
pub fn expect_layer(self) -> LayerRule where
Self: Debug,
sourcepub fn layer(self) -> Option<LayerRule>
pub fn layer(self) -> Option<LayerRule>
Returns Some
if self
is of variant Layer
, and None
otherwise.
sourcepub fn as_media(&self) -> Option<&MediaRule>
pub fn as_media(&self) -> Option<&MediaRule>
Returns Some
if self
is a reference of variant Media
, and None
otherwise.
sourcepub fn expect_media(self) -> MediaRule where
Self: Debug,
pub fn expect_media(self) -> MediaRule where
Self: Debug,
sourcepub fn media(self) -> Option<MediaRule>
pub fn media(self) -> Option<MediaRule>
Returns Some
if self
is of variant Media
, and None
otherwise.
sourcepub fn is_supports(&self) -> bool
pub fn is_supports(&self) -> bool
Returns true
if self
is of variant Supports
.
sourcepub fn as_supports(&self) -> Option<&SupportsRule>
pub fn as_supports(&self) -> Option<&SupportsRule>
Returns Some
if self
is a reference of variant Supports
, and None
otherwise.
sourcepub fn expect_supports(self) -> SupportsRule where
Self: Debug,
pub fn expect_supports(self) -> SupportsRule where
Self: Debug,
sourcepub fn supports(self) -> Option<SupportsRule>
pub fn supports(self) -> Option<SupportsRule>
Returns Some
if self
is of variant Supports
, and None
otherwise.
sourcepub fn as_page(&self) -> Option<&PageRule>
pub fn as_page(&self) -> Option<&PageRule>
Returns Some
if self
is a reference of variant Page
, and None
otherwise.
sourcepub fn expect_page(self) -> PageRule where
Self: Debug,
pub fn expect_page(self) -> PageRule where
Self: Debug,
sourcepub fn page(self) -> Option<PageRule>
pub fn page(self) -> Option<PageRule>
Returns Some
if self
is of variant Page
, and None
otherwise.
sourcepub fn is_page_margin(&self) -> bool
pub fn is_page_margin(&self) -> bool
Returns true
if self
is of variant PageMargin
.
sourcepub fn as_page_margin(&self) -> Option<&PageMarginRule>
pub fn as_page_margin(&self) -> Option<&PageMarginRule>
Returns Some
if self
is a reference of variant PageMargin
, and None
otherwise.
sourcepub fn expect_page_margin(self) -> PageMarginRule where
Self: Debug,
pub fn expect_page_margin(self) -> PageMarginRule where
Self: Debug,
Unwraps the value, yielding the content of PageMargin
.
Panics
Panics if the value is not PageMargin
, with a panic message including the content of self
.
sourcepub fn page_margin(self) -> Option<PageMarginRule>
pub fn page_margin(self) -> Option<PageMarginRule>
Returns Some
if self
is of variant PageMargin
, and None
otherwise.
sourcepub fn is_namespace(&self) -> bool
pub fn is_namespace(&self) -> bool
Returns true
if self
is of variant Namespace
.
sourcepub fn as_namespace(&self) -> Option<&NamespaceRule>
pub fn as_namespace(&self) -> Option<&NamespaceRule>
Returns Some
if self
is a reference of variant Namespace
, and None
otherwise.
sourcepub fn expect_namespace(self) -> NamespaceRule where
Self: Debug,
pub fn expect_namespace(self) -> NamespaceRule where
Self: Debug,
sourcepub fn namespace(self) -> Option<NamespaceRule>
pub fn namespace(self) -> Option<NamespaceRule>
Returns Some
if self
is of variant Namespace
, and None
otherwise.
sourcepub fn as_nest(&self) -> Option<&NestRule>
pub fn as_nest(&self) -> Option<&NestRule>
Returns Some
if self
is a reference of variant Nest
, and None
otherwise.
sourcepub fn expect_nest(self) -> NestRule where
Self: Debug,
pub fn expect_nest(self) -> NestRule where
Self: Debug,
sourcepub fn nest(self) -> Option<NestRule>
pub fn nest(self) -> Option<NestRule>
Returns Some
if self
is of variant Nest
, and None
otherwise.
sourcepub fn is_viewport(&self) -> bool
pub fn is_viewport(&self) -> bool
Returns true
if self
is of variant Viewport
.
sourcepub fn as_viewport(&self) -> Option<&ViewportRule>
pub fn as_viewport(&self) -> Option<&ViewportRule>
Returns Some
if self
is a reference of variant Viewport
, and None
otherwise.
sourcepub fn expect_viewport(self) -> ViewportRule where
Self: Debug,
pub fn expect_viewport(self) -> ViewportRule where
Self: Debug,
sourcepub fn viewport(self) -> Option<ViewportRule>
pub fn viewport(self) -> Option<ViewportRule>
Returns Some
if self
is of variant Viewport
, and None
otherwise.
sourcepub fn is_document(&self) -> bool
pub fn is_document(&self) -> bool
Returns true
if self
is of variant Document
.
sourcepub fn as_document(&self) -> Option<&DocumentRule>
pub fn as_document(&self) -> Option<&DocumentRule>
Returns Some
if self
is a reference of variant Document
, and None
otherwise.
sourcepub fn expect_document(self) -> DocumentRule where
Self: Debug,
pub fn expect_document(self) -> DocumentRule where
Self: Debug,
sourcepub fn document(self) -> Option<DocumentRule>
pub fn document(self) -> Option<DocumentRule>
Returns Some
if self
is of variant Document
, and None
otherwise.
sourcepub fn is_color_profile(&self) -> bool
pub fn is_color_profile(&self) -> bool
Returns true
if self
is of variant ColorProfile
.
sourcepub fn as_color_profile(&self) -> Option<&ColorProfileRule>
pub fn as_color_profile(&self) -> Option<&ColorProfileRule>
Returns Some
if self
is a reference of variant ColorProfile
, and None
otherwise.
sourcepub fn expect_color_profile(self) -> ColorProfileRule where
Self: Debug,
pub fn expect_color_profile(self) -> ColorProfileRule where
Self: Debug,
Unwraps the value, yielding the content of ColorProfile
.
Panics
Panics if the value is not ColorProfile
, with a panic message including the content of self
.
sourcepub fn color_profile(self) -> Option<ColorProfileRule>
pub fn color_profile(self) -> Option<ColorProfileRule>
Returns Some
if self
is of variant ColorProfile
, and None
otherwise.
sourcepub fn is_counter_style(&self) -> bool
pub fn is_counter_style(&self) -> bool
Returns true
if self
is of variant CounterStyle
.
sourcepub fn as_counter_style(&self) -> Option<&CounterStyleRule>
pub fn as_counter_style(&self) -> Option<&CounterStyleRule>
Returns Some
if self
is a reference of variant CounterStyle
, and None
otherwise.
sourcepub fn expect_counter_style(self) -> CounterStyleRule where
Self: Debug,
pub fn expect_counter_style(self) -> CounterStyleRule where
Self: Debug,
Unwraps the value, yielding the content of CounterStyle
.
Panics
Panics if the value is not CounterStyle
, with a panic message including the content of self
.
sourcepub fn counter_style(self) -> Option<CounterStyleRule>
pub fn counter_style(self) -> Option<CounterStyleRule>
Returns Some
if self
is of variant CounterStyle
, and None
otherwise.
sourcepub fn is_property(&self) -> bool
pub fn is_property(&self) -> bool
Returns true
if self
is of variant Property
.
sourcepub fn as_property(&self) -> Option<&PropertyRule>
pub fn as_property(&self) -> Option<&PropertyRule>
Returns Some
if self
is a reference of variant Property
, and None
otherwise.
sourcepub fn expect_property(self) -> PropertyRule where
Self: Debug,
pub fn expect_property(self) -> PropertyRule where
Self: Debug,
sourcepub fn property(self) -> Option<PropertyRule>
pub fn property(self) -> Option<PropertyRule>
Returns Some
if self
is of variant Property
, and None
otherwise.
sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true
if self
is of variant Unknown
.
sourcepub fn as_unknown(&self) -> Option<&UnknownAtRule>
pub fn as_unknown(&self) -> Option<&UnknownAtRule>
Returns Some
if self
is a reference of variant Unknown
, and None
otherwise.
sourcepub fn expect_unknown(self) -> UnknownAtRule where
Self: Debug,
pub fn expect_unknown(self) -> UnknownAtRule where
Self: Debug,
sourcepub fn unknown(self) -> Option<UnknownAtRule>
pub fn unknown(self) -> Option<UnknownAtRule>
Returns Some
if self
is of variant Unknown
, and None
otherwise.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for AtRule
impl<'de> Deserialize<'de> for AtRule
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 From<AtRule> for DeclarationOrAtRule
impl From<AtRule> for DeclarationOrAtRule
sourceimpl From<CharsetRule> for AtRule
impl From<CharsetRule> for AtRule
sourcefn from(v: CharsetRule) -> Self
fn from(v: CharsetRule) -> Self
Performs the conversion.
sourceimpl From<ColorProfileRule> for AtRule
impl From<ColorProfileRule> for AtRule
sourcefn from(v: ColorProfileRule) -> Self
fn from(v: ColorProfileRule) -> Self
Performs the conversion.
sourceimpl From<CounterStyleRule> for AtRule
impl From<CounterStyleRule> for AtRule
sourcefn from(v: CounterStyleRule) -> Self
fn from(v: CounterStyleRule) -> Self
Performs the conversion.
sourceimpl From<DocumentRule> for AtRule
impl From<DocumentRule> for AtRule
sourcefn from(v: DocumentRule) -> Self
fn from(v: DocumentRule) -> Self
Performs the conversion.
sourceimpl From<FontFaceRule> for AtRule
impl From<FontFaceRule> for AtRule
sourcefn from(v: FontFaceRule) -> Self
fn from(v: FontFaceRule) -> Self
Performs the conversion.
sourceimpl From<ImportRule> for AtRule
impl From<ImportRule> for AtRule
sourcefn from(v: ImportRule) -> Self
fn from(v: ImportRule) -> Self
Performs the conversion.
sourceimpl From<KeyframesRule> for AtRule
impl From<KeyframesRule> for AtRule
sourcefn from(v: KeyframesRule) -> Self
fn from(v: KeyframesRule) -> Self
Performs the conversion.
sourceimpl From<NamespaceRule> for AtRule
impl From<NamespaceRule> for AtRule
sourcefn from(v: NamespaceRule) -> Self
fn from(v: NamespaceRule) -> Self
Performs the conversion.
sourceimpl From<PageMarginRule> for AtRule
impl From<PageMarginRule> for AtRule
sourcefn from(v: PageMarginRule) -> Self
fn from(v: PageMarginRule) -> Self
Performs the conversion.
sourceimpl From<PropertyRule> for AtRule
impl From<PropertyRule> for AtRule
sourcefn from(v: PropertyRule) -> Self
fn from(v: PropertyRule) -> Self
Performs the conversion.
sourceimpl From<SupportsRule> for AtRule
impl From<SupportsRule> for AtRule
sourcefn from(v: SupportsRule) -> Self
fn from(v: SupportsRule) -> Self
Performs the conversion.
sourceimpl From<UnknownAtRule> for AtRule
impl From<UnknownAtRule> for AtRule
sourcefn from(v: UnknownAtRule) -> Self
fn from(v: UnknownAtRule) -> Self
Performs the conversion.
sourceimpl From<ViewportRule> for AtRule
impl From<ViewportRule> for AtRule
sourcefn from(v: ViewportRule) -> Self
fn from(v: ViewportRule) -> Self
Performs the conversion.
impl StructuralPartialEq for AtRule
Auto Trait Implementations
impl RefUnwindSafe for AtRule
impl Send for AtRule
impl Sync for AtRule
impl Unpin for AtRule
impl UnwindSafe for AtRule
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