[−][src]Trait latex::Visitor
A trait which uses the Visitor Pattern to recursively visit each node in
a Document
.
Provided methods
fn visit_document(&mut self, doc: &Document) -> Result<(), Error>
Visit the root Document
node, then recursively visit the preamble and
each element in the Document
.
fn visit_element(&mut self, elem: &Element) -> Result<(), Error>
Visit a single Element
node, dispatching to the more specific
visit_*()
methods.
Note: You probably don't want to implement this one yourself. If you forget to recursively visit each and every variant of
Element
you may end up accidentally ignoring half your document!
fn visit_preamble(&mut self, preamble: &Preamble) -> Result<(), Error>
Visit a document's Preamble
.
fn visit_paragraph_element(
&mut self,
element: &ParagraphElement
) -> Result<(), Error>
&mut self,
element: &ParagraphElement
) -> Result<(), Error>
Visit an element in a Paragraph
(e.g. Italic
, InlineCode
).
fn visit_user_defined_line(&mut self, line: &str) -> Result<(), Error>
Visit a user defined line.
fn visit_input(&mut self, input: &str) -> Result<(), Error>
Visit a input element.
fn visit_paragraph(&mut self, paragraph: &Paragraph) -> Result<(), Error>
Visit a paragraph, and every ParagraphElement
in it.
fn visit_section(&mut self, section: &Section) -> Result<(), Error>
Visit a Section
and then recursively visit each of its Element
s.
fn visit_align(&mut self, align: &Align) -> Result<(), Error>
Visit an Align
block and then recursively visit each equation in the
block.
fn visit_equation(&mut self, equation: &Equation) -> Result<(), Error>
Visit a single Equation
.
fn visit_list(&mut self, list: &List) -> Result<(), Error>
Visit a List
and all of its items.
fn visit_list_item(&mut self, item: &Item) -> Result<(), Error>
Visit a single list item.
fn visit_custom_environment<'a, I>(
&mut self,
name: &str,
lines: I
) -> Result<(), Error> where
I: Iterator<Item = &'a str>,
&mut self,
name: &str,
lines: I
) -> Result<(), Error> where
I: Iterator<Item = &'a str>,
Visit an arbitrary environment and receive an iterator over its lines.