Struct rsvg::css::RuleParser
source · pub struct RuleParser {
session: Session,
}
Expand description
Struct to implement cssparser::QualifiedRuleParser and cssparser::AtRuleParser
Fields§
§session: Session
Trait Implementations§
source§impl<'i> AtRuleParser<'i> for RuleParser
impl<'i> AtRuleParser<'i> for RuleParser
§type Prelude = AtRulePrelude
type Prelude = AtRulePrelude
The intermediate representation of prelude of an at-rule.
§type Error = ValueErrorKind
type Error = ValueErrorKind
The error type that is included in the ParseError value that can be returned.
source§fn parse_prelude<'t>(
&mut self,
name: CowRcStr<'i>,
input: &mut Parser<'i, 't>
) -> Result<Self::Prelude, ParseError<'i, Self::Error>>
fn parse_prelude<'t>( &mut self, name: CowRcStr<'i>, input: &mut Parser<'i, 't> ) -> Result<Self::Prelude, ParseError<'i, Self::Error>>
Parse the prelude of an at-rule with the given
name
. Read moresource§fn rule_without_block(
&mut self,
prelude: Self::Prelude,
_start: &ParserState
) -> Result<Self::AtRule, ()>
fn rule_without_block( &mut self, prelude: Self::Prelude, _start: &ParserState ) -> Result<Self::AtRule, ()>
End an at-rule which doesn’t have block. Return the finished
representation of the at-rule. Read more
§fn parse_block<'t>(
&mut self,
prelude: Self::Prelude,
start: &ParserState,
input: &mut Parser<'i, 't>
) -> Result<Self::AtRule, ParseError<'i, Self::Error>>
fn parse_block<'t>( &mut self, prelude: Self::Prelude, start: &ParserState, input: &mut Parser<'i, 't> ) -> Result<Self::AtRule, ParseError<'i, Self::Error>>
Parse the content of a
{ /* ... */ }
block for the body of the at-rule. Read moresource§impl<'i> Parser<'i> for RuleParser
impl<'i> Parser<'i> for RuleParser
type Impl = Selector
type Error = ParseErrorKind<'i>
fn default_namespace( &self ) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl>
fn namespace_for_prefix( &self, _prefix: &<Self::Impl as SelectorImpl>::NamespacePrefix ) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl>
source§fn parse_non_ts_pseudo_class(
&self,
location: SourceLocation,
name: CowRcStr<'i>
) -> Result<NonTSPseudoClass, ParseError<'i, Self::Error>>
fn parse_non_ts_pseudo_class( &self, location: SourceLocation, name: CowRcStr<'i> ) -> Result<NonTSPseudoClass, ParseError<'i, Self::Error>>
This function can return an “Err” pseudo-element in order to support CSS2.1
pseudo-elements.
fn parse_non_ts_functional_pseudo_class( &self, name: CowRcStr<'i>, arguments: &mut Parser<'i, '_> ) -> Result<NonTSPseudoClass, ParseError<'i, Self::Error>>
§fn parse_slotted(&self) -> bool
fn parse_slotted(&self) -> bool
Whether to parse the
::slotted()
pseudo-element.§fn parse_part(&self) -> bool
fn parse_part(&self) -> bool
Whether to parse the
::part()
pseudo-element.§fn parse_nth_child_of(&self) -> bool
fn parse_nth_child_of(&self) -> bool
Whether to parse the selector list of nth-child() or nth-last-child().
§fn parse_is_and_where(&self) -> bool
fn parse_is_and_where(&self) -> bool
Whether to parse the
:where
pseudo-class.§fn parse_parent_selector(&self) -> bool
fn parse_parent_selector(&self) -> bool
Whether to parse the ‘&’ delimiter as a parent selector.
§fn is_is_alias(&self, _name: &str) -> bool
fn is_is_alias(&self, _name: &str) -> bool
Whether the given function name is an alias for the
:is()
function.§fn parse_host(&self) -> bool
fn parse_host(&self) -> bool
Whether to parse the
:host
pseudo-class.§fn allow_forgiving_selectors(&self) -> bool
fn allow_forgiving_selectors(&self) -> bool
Whether to allow forgiving selector-list parsing.
fn parse_pseudo_element( &self, location: SourceLocation, name: CowRcStr<'i> ) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>
fn parse_functional_pseudo_element<'t>( &self, name: CowRcStr<'i>, arguments: &mut Parser<'i, 't> ) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>
source§impl<'i> QualifiedRuleParser<'i> for RuleParser
impl<'i> QualifiedRuleParser<'i> for RuleParser
§type QualifiedRule = Rule
type QualifiedRule = Rule
The finished representation of a qualified rule.
§type Error = ValueErrorKind
type Error = ValueErrorKind
The error type that is included in the ParseError value that can be returned.
source§fn parse_prelude<'t>(
&mut self,
input: &mut Parser<'i, 't>
) -> Result<Self::Prelude, ParseError<'i, Self::Error>>
fn parse_prelude<'t>( &mut self, input: &mut Parser<'i, 't> ) -> Result<Self::Prelude, ParseError<'i, Self::Error>>
Parse the prelude of a qualified rule. For style rules, this is as Selector list. Read more
source§fn parse_block<'t>(
&mut self,
prelude: Self::Prelude,
_start: &ParserState,
input: &mut Parser<'i, 't>
) -> Result<Self::QualifiedRule, ParseError<'i, Self::Error>>
fn parse_block<'t>( &mut self, prelude: Self::Prelude, _start: &ParserState, input: &mut Parser<'i, 't> ) -> Result<Self::QualifiedRule, ParseError<'i, Self::Error>>
Parse the content of a
{ /* ... */ }
block for the body of the qualified rule. Read moreAuto Trait Implementations§
impl RefUnwindSafe for RuleParser
impl Send for RuleParser
impl Sync for RuleParser
impl Unpin for RuleParser
impl UnwindSafe for RuleParser
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
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.