[][src]Struct cssparser::RuleListParser

pub struct RuleListParser<'i, 't, 'a, P> {
    pub input: &'a mut Parser<'i, 't>,
    pub parser: P,
    // some fields omitted
}

Provides an iterator for rule list parsing.

Fields

input: &'a mut Parser<'i, 't>

The input given to RuleListParser::new

parser: P

The parser given to RuleListParser::new

Methods

impl<'i, 't, 'a, R, P, E: 'i> RuleListParser<'i, 't, 'a, P> where
    P: QualifiedRuleParser<'i, QualifiedRule = R, Error = E> + AtRuleParser<'i, AtRule = R, Error = E>, 
[src]

pub fn new_for_stylesheet(input: &'a mut Parser<'i, 't>, parser: P) -> Self[src]

Create a new RuleListParser for the given input at the top-level of a stylesheet and the given parser.

The given parser needs to implement both QualifiedRuleParser and AtRuleParser traits. However, either of them can be an empty impl since the traits provide default implementations of their methods.

The return type for finished qualified rules and at-rules also needs to be the same, since <RuleListParser as Iterator>::next can return either. It could be a custom enum.

pub fn new_for_nested_rule(input: &'a mut Parser<'i, 't>, parser: P) -> Self[src]

Same is new_for_stylesheet, but should be used for rule lists inside a block such as the body of an @media rule.

This differs in that <!-- and --> tokens should only be ignored at the stylesheet top-level. (This is to deal with legacy work arounds for <style> HTML element parsing.)

Trait Implementations

impl<'i, 't, 'a, R, P, E: 'i> Iterator for RuleListParser<'i, 't, 'a, P> where
    P: QualifiedRuleParser<'i, QualifiedRule = R, Error = E> + AtRuleParser<'i, AtRule = R, Error = E>, 
[src]

RuleListParser is an iterator that yields Ok(_) for a rule or Err(()) for an invalid one.

type Item = Result<R, (ParseError<'i, E>, &'i str)>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'i, 't, 'a, P> !Send for RuleListParser<'i, 't, 'a, P>

impl<'i, 't, 'a, P> !Sync for RuleListParser<'i, 't, 'a, P>

impl<'i, 't, 'a, P> Unpin for RuleListParser<'i, 't, 'a, P> where
    P: Unpin,
    'i: 'a,
    't: 'a, 

impl<'i, 't, 'a, P> !UnwindSafe for RuleListParser<'i, 't, 'a, P>

impl<'i, 't, 'a, P> !RefUnwindSafe for RuleListParser<'i, 't, 'a, P>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]