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

§

type Prelude = AtRulePrelude

The intermediate representation of prelude of an at-rule.
§

type AtRule = Rule

The finished representation of an at-rule.
§

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>>

Parse the prelude of an at-rule with the given name. Read more
source§

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>>

Parse the content of a { /* ... */ } block for the body of the at-rule. Read more
source§

impl<'i> Parser<'i> for RuleParser

§

type Impl = Selector

§

type Error = ParseErrorKind<'i>

source§

fn default_namespace( &self ) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl>

source§

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>>

This function can return an “Err” pseudo-element in order to support CSS2.1 pseudo-elements.
source§

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

Whether to parse the ::slotted() pseudo-element.
§

fn parse_part(&self) -> bool

Whether to parse the ::part() pseudo-element.
§

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

Whether to parse the :where pseudo-class.
§

fn parse_has(&self) -> bool

Whether to parse the :has pseudo-class.
§

fn parse_parent_selector(&self) -> bool

Whether to parse the ‘&’ delimiter as a parent selector.
§

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

Whether to parse the :host pseudo-class.
§

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

§

type Prelude = SelectorList<Selector>

The intermediate representation of a qualified rule prelude.
§

type QualifiedRule = Rule

The finished representation of a qualified rule.
§

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>>

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>>

Parse the content of a { /* ... */ } block for the body of the qualified rule. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.