Struct rsvg::css::DeclParser
source · pub struct DeclParser;
Expand description
Dummy struct required to use cssparser::DeclarationListParser
It implements cssparser::DeclarationParser
, which knows how to parse
the property/value pairs from a CSS declaration.
Trait Implementations§
source§impl<'i> AtRuleParser<'i> for DeclParser
impl<'i> AtRuleParser<'i> for DeclParser
§type AtRule = RuleBodyItem
type AtRule = RuleBodyItem
The finished representation of an at-rule.
§type Error = ValueErrorKind
type Error = ValueErrorKind
The error type that is included in the ParseError value that can be returned.
§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 more§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> DeclarationParser<'i> for DeclParser
impl<'i> DeclarationParser<'i> for DeclParser
source§fn parse_value<'t>(
&mut self,
name: CowRcStr<'i>,
input: &mut Parser<'i, 't>
) -> Result<RuleBodyItem, ParseError<'i, Self::Error>>
fn parse_value<'t>( &mut self, name: CowRcStr<'i>, input: &mut Parser<'i, 't> ) -> Result<RuleBodyItem, ParseError<'i, Self::Error>>
Parses a CSS declaration like name: input_value [!important]
§type Declaration = RuleBodyItem
type Declaration = RuleBodyItem
The finished representation of a declaration.
§type Error = ValueErrorKind
type Error = ValueErrorKind
The error type that is included in the ParseError value that can be returned.
source§impl<'i> QualifiedRuleParser<'i> for DeclParser
impl<'i> QualifiedRuleParser<'i> for DeclParser
We need this dummy implementation as well.
§type QualifiedRule = RuleBodyItem
type QualifiedRule = RuleBodyItem
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.
§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
§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 moresource§impl<'i> RuleBodyItemParser<'i, RuleBodyItem, ValueErrorKind> for DeclParser
impl<'i> RuleBodyItemParser<'i, RuleBodyItem, ValueErrorKind> for DeclParser
source§fn parse_declarations(&self) -> bool
fn parse_declarations(&self) -> bool
We want to parse declarations.
source§fn parse_qualified(&self) -> bool
fn parse_qualified(&self) -> bool
We don’t wanto parse qualified rules though.
Auto Trait Implementations§
impl RefUnwindSafe for DeclParser
impl Send for DeclParser
impl Sync for DeclParser
impl Unpin for DeclParser
impl UnwindSafe for DeclParser
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.