NodeHandler

Trait NodeHandler 

Source
pub trait NodeHandler {
    type Error;

Show 26 methods // Provided methods fn visit_node(&mut self, node: &Node) -> Result<(), Self::Error> { ... } fn visit_nodes(&mut self, nodes: &[Node]) -> Result<(), Self::Error> { ... } fn document(&mut self, children: &[Node]) -> Result<(), Self::Error> { ... } fn paragraph(&mut self, content: &[Node]) -> Result<(), Self::Error> { ... } fn text(&mut self, _text: &EcoString) -> Result<(), Self::Error> { ... } fn emphasis(&mut self, content: &[Node]) -> Result<(), Self::Error> { ... } fn strong(&mut self, content: &[Node]) -> Result<(), Self::Error> { ... } fn thematic_break(&mut self) -> Result<(), Self::Error> { ... } fn heading( &mut self, _level: u8, content: &[Node], _heading_type: &HeadingType, ) -> Result<(), Self::Error> { ... } fn inline_code(&mut self, _code: &EcoString) -> Result<(), Self::Error> { ... } fn code_block( &mut self, _language: &Option<EcoString>, _content: &EcoString, _kind: &CodeBlockType, ) -> Result<(), Self::Error> { ... } fn html_block(&mut self, _content: &EcoString) -> Result<(), Self::Error> { ... } fn html_element( &mut self, _element: &HtmlElement, ) -> Result<(), Self::Error> { ... } fn block_quote(&mut self, content: &[Node]) -> Result<(), Self::Error> { ... } fn unordered_list(&mut self, _items: &[ListItem]) -> Result<(), Self::Error> { ... } fn ordered_list( &mut self, _start: u32, _items: &[ListItem], ) -> Result<(), Self::Error> { ... } fn table( &mut self, _headers: &[Node], _rows: &[Vec<Node>], ) -> Result<(), Self::Error> { ... } fn link( &mut self, _url: &EcoString, _title: &Option<EcoString>, content: &[Node], ) -> Result<(), Self::Error> { ... } fn image( &mut self, _url: &EcoString, _title: &Option<EcoString>, _alt: &[Node], ) -> Result<(), Self::Error> { ... } fn soft_break(&mut self) -> Result<(), Self::Error> { ... } fn hard_break(&mut self) -> Result<(), Self::Error> { ... } fn autolink( &mut self, _url: &EcoString, _is_email: bool, ) -> Result<(), Self::Error> { ... } fn link_reference_definition( &mut self, _label: &EcoString, _destination: &EcoString, _title: &Option<EcoString>, ) -> Result<(), Self::Error> { ... } fn reference_link( &mut self, _label: &EcoString, content: &[Node], ) -> Result<(), Self::Error> { ... } fn custom(&mut self, _node: &dyn CustomNode) -> Result<(), Self::Error> { ... } fn unsupported(&mut self, _node: &Node) -> Result<(), Self::Error> { ... }
}
Expand description

Trait implemented by writer backends that want to consume the AST.

Required Associated Types§

Source

type Error

Error type produced during traversal.

Provided Methods§

Source

fn visit_node(&mut self, node: &Node) -> Result<(), Self::Error>

Dispatch a single node. Most implementers will not override this and will instead implement the per-variant methods below.

Source

fn visit_nodes(&mut self, nodes: &[Node]) -> Result<(), Self::Error>

Visit a sequence of nodes.

Source

fn document(&mut self, children: &[Node]) -> Result<(), Self::Error>

Source

fn paragraph(&mut self, content: &[Node]) -> Result<(), Self::Error>

Source

fn text(&mut self, _text: &EcoString) -> Result<(), Self::Error>

Source

fn emphasis(&mut self, content: &[Node]) -> Result<(), Self::Error>

Source

fn strong(&mut self, content: &[Node]) -> Result<(), Self::Error>

Source

fn thematic_break(&mut self) -> Result<(), Self::Error>

Source

fn heading( &mut self, _level: u8, content: &[Node], _heading_type: &HeadingType, ) -> Result<(), Self::Error>

Source

fn inline_code(&mut self, _code: &EcoString) -> Result<(), Self::Error>

Source

fn code_block( &mut self, _language: &Option<EcoString>, _content: &EcoString, _kind: &CodeBlockType, ) -> Result<(), Self::Error>

Source

fn html_block(&mut self, _content: &EcoString) -> Result<(), Self::Error>

Source

fn html_element(&mut self, _element: &HtmlElement) -> Result<(), Self::Error>

Source

fn block_quote(&mut self, content: &[Node]) -> Result<(), Self::Error>

Source

fn unordered_list(&mut self, _items: &[ListItem]) -> Result<(), Self::Error>

Source

fn ordered_list( &mut self, _start: u32, _items: &[ListItem], ) -> Result<(), Self::Error>

Source

fn table( &mut self, _headers: &[Node], _rows: &[Vec<Node>], ) -> Result<(), Self::Error>

Source

fn image( &mut self, _url: &EcoString, _title: &Option<EcoString>, _alt: &[Node], ) -> Result<(), Self::Error>

Source

fn soft_break(&mut self) -> Result<(), Self::Error>

Source

fn hard_break(&mut self) -> Result<(), Self::Error>

Source

fn custom(&mut self, _node: &dyn CustomNode) -> Result<(), Self::Error>

Source

fn unsupported(&mut self, _node: &Node) -> Result<(), Self::Error>

Implementors§