Module somedoc::model::visitor [−][src]
This module provides a set of traits for implementing model visitors as well as the function
walk_document
that walks a visitor over a specific Document
.
Example
The following is a version of the actual function provided by the write::xwiki
module and
shows how the writer has been implemented as a visitor.
ⓘ
pub fn writer<W: Write>(doc: &Document, w: &mut W) -> crate::error::Result<()> { info!("xwiki::writer(.., ..)"); let writer = XWikiWriter::new(w); walk_document(doc, &writer)?; Ok(()) }
Traits
BlockVisitor | The visitor trait for all block content instances. |
DocumentVisitor | The visitor trait for a |
InlineVisitor | The visitor trait for all inline content instances. |
TableVisitor | The visitor trait for all |
Functions
walk_document | Walk the specified |