Trait toks::Tok

source ·
pub trait Tok {
    // Required methods
    fn is_match(&self, qual_name: &QualName) -> bool;
    fn process(
        &mut self,
        attributes: &mut Vec<Attribute>,
        children: &mut Vec<Handle>
    );
}
Expand description

Tok in short for token which is used to recursively walk through rcdom::Handle when QualName match is found process function is called.

Combining Tok’s into Vec makes it advantageous to walk HTML DOM only once and collect all interested elements.

Required Methods§

source

fn is_match(&self, qual_name: &QualName) -> bool

Matcher function which matches predefined QualName.

Depending on the result of boolean match this allows process function to proceed.

source

fn process( &mut self, attributes: &mut Vec<Attribute>, children: &mut Vec<Handle> )

Process function gets matched QualName attributes and children of matched element.

Implementors§