pub trait HtmlWriter<W: StrWrite> {
Show 56 methods
// Required methods
fn get_config(&self) -> &HtmlConfig;
fn get_writer(&mut self) -> &mut W;
fn get_state(&mut self) -> &mut HtmlState;
// Provided methods
fn write_str(&mut self, s: &str) -> Result<(), HtmlError> { ... }
fn write_attributes(&mut self, element: &str) -> Result<(), HtmlError> { ... }
fn is_external_link(&self, url: &str) -> bool { ... }
fn start_paragraph(&mut self) -> Result<(), HtmlError> { ... }
fn end_paragraph(&mut self) -> Result<(), HtmlError> { ... }
fn start_heading(
&mut self,
level: HeadingLevel,
id: Option<&str>,
classes: &[CowStr<'_>],
attrs: &Vec<(CowStr<'_>, Option<CowStr<'_>>)>,
) -> Result<(), HtmlError> { ... }
fn end_heading(&mut self, level: HeadingLevel) -> Result<(), HtmlError> { ... }
fn start_blockquote(&mut self) -> Result<(), HtmlError> { ... }
fn end_blockquote(&mut self) -> Result<(), HtmlError> { ... }
fn start_code_block(
&mut self,
kind: CodeBlockKind<'_>,
) -> Result<(), HtmlError> { ... }
fn end_code_block(&mut self) -> Result<(), HtmlError> { ... }
fn start_inline_code(&mut self) -> Result<(), HtmlError> { ... }
fn end_inline_code(&mut self) -> Result<(), HtmlError> { ... }
fn start_list(&mut self, first_number: Option<u64>) -> Result<(), HtmlError> { ... }
fn end_list(&mut self, ordered: bool) -> Result<(), HtmlError> { ... }
fn start_list_item(&mut self) -> Result<(), HtmlError> { ... }
fn end_list_item(&mut self) -> Result<(), HtmlError> { ... }
fn start_table(
&mut self,
alignments: Vec<Alignment>,
) -> Result<(), HtmlError> { ... }
fn end_table(&mut self) -> Result<(), HtmlError> { ... }
fn start_table_head(&mut self) -> Result<(), HtmlError> { ... }
fn end_table_head(&mut self) -> Result<(), HtmlError> { ... }
fn start_table_row(&mut self) -> Result<(), HtmlError> { ... }
fn end_table_row(&mut self) -> Result<(), HtmlError> { ... }
fn start_table_cell(&mut self) -> Result<(), HtmlError> { ... }
fn end_table_cell(&mut self) -> Result<(), HtmlError> { ... }
fn start_emphasis(&mut self) -> Result<(), HtmlError> { ... }
fn end_emphasis(&mut self) -> Result<(), HtmlError> { ... }
fn start_strong(&mut self) -> Result<(), HtmlError> { ... }
fn end_strong(&mut self) -> Result<(), HtmlError> { ... }
fn start_strikethrough(&mut self) -> Result<(), HtmlError> { ... }
fn end_strikethrough(&mut self) -> Result<(), HtmlError> { ... }
fn start_link(
&mut self,
_link_type: LinkType,
dest: &str,
title: &str,
) -> Result<(), HtmlError> { ... }
fn end_link(&mut self) -> Result<(), HtmlError> { ... }
fn start_image<'a, I>(
&mut self,
_link_type: LinkType,
dest: &str,
title: &str,
iter: &mut Peekable<I>,
) -> Result<(), HtmlError>
where I: Iterator<Item = Event<'a>> { ... }
fn end_image(&mut self) -> Result<(), HtmlError> { ... }
fn footnote_reference(&mut self, name: &str) -> Result<(), HtmlError> { ... }
fn start_footnote_definition(&mut self, name: &str) -> Result<(), HtmlError> { ... }
fn end_footnote_definition(&mut self) -> Result<(), HtmlError> { ... }
fn task_list_item(&mut self, checked: bool) -> Result<(), HtmlError> { ... }
fn horizontal_rule(&mut self) -> Result<(), HtmlError> { ... }
fn soft_break(&mut self) -> Result<(), HtmlError> { ... }
fn hard_break(&mut self) -> Result<(), HtmlError> { ... }
fn text(&mut self, text: &str) -> Result<(), HtmlError> { ... }
fn start_definition_list(&mut self) -> Result<(), HtmlError> { ... }
fn end_definition_list(&mut self) -> Result<(), HtmlError> { ... }
fn start_definition_list_title(&mut self) -> Result<(), HtmlError> { ... }
fn end_definition_list_title(&mut self) -> Result<(), HtmlError> { ... }
fn start_definition_list_definition(&mut self) -> Result<(), HtmlError> { ... }
fn end_definition_list_definition(&mut self) -> Result<(), HtmlError> { ... }
fn start_metadata_block(
&mut self,
_metadata_type: &MetadataBlockKind,
) -> Result<(), HtmlError> { ... }
fn end_metadata_block(&mut self) -> Result<(), HtmlError> { ... }
fn html_raw(&mut self, html: &CowStr<'_>) -> Result<(), HtmlError> { ... }
fn collect_alt_text<'a, I>(&self, iter: &mut Peekable<I>) -> String
where I: Iterator<Item = Event<'a>> { ... }
}
Expand description
Trait for handling Markdown tag rendering to HTML
Required Methods§
fn get_config(&self) -> &HtmlConfig
fn get_writer(&mut self) -> &mut W
fn get_state(&mut self) -> &mut HtmlState
Provided Methods§
Sourcefn write_str(&mut self, s: &str) -> Result<(), HtmlError>
fn write_str(&mut self, s: &str) -> Result<(), HtmlError>
Write a string directly to the output
Sourcefn write_attributes(&mut self, element: &str) -> Result<(), HtmlError>
fn write_attributes(&mut self, element: &str) -> Result<(), HtmlError>
Write HTML attributes for a given element
Sourcefn is_external_link(&self, url: &str) -> bool
fn is_external_link(&self, url: &str) -> bool
Check if a URL points to an external resource
fn start_paragraph(&mut self) -> Result<(), HtmlError>
fn end_paragraph(&mut self) -> Result<(), HtmlError>
fn start_heading( &mut self, level: HeadingLevel, id: Option<&str>, classes: &[CowStr<'_>], attrs: &Vec<(CowStr<'_>, Option<CowStr<'_>>)>, ) -> Result<(), HtmlError>
fn end_heading(&mut self, level: HeadingLevel) -> Result<(), HtmlError>
fn start_blockquote(&mut self) -> Result<(), HtmlError>
fn end_blockquote(&mut self) -> Result<(), HtmlError>
fn start_code_block(&mut self, kind: CodeBlockKind<'_>) -> Result<(), HtmlError>
fn end_code_block(&mut self) -> Result<(), HtmlError>
fn start_inline_code(&mut self) -> Result<(), HtmlError>
fn end_inline_code(&mut self) -> Result<(), HtmlError>
fn start_list(&mut self, first_number: Option<u64>) -> Result<(), HtmlError>
fn end_list(&mut self, ordered: bool) -> Result<(), HtmlError>
fn start_list_item(&mut self) -> Result<(), HtmlError>
fn end_list_item(&mut self) -> Result<(), HtmlError>
fn start_table(&mut self, alignments: Vec<Alignment>) -> Result<(), HtmlError>
fn end_table(&mut self) -> Result<(), HtmlError>
fn start_table_head(&mut self) -> Result<(), HtmlError>
fn end_table_head(&mut self) -> Result<(), HtmlError>
fn start_table_row(&mut self) -> Result<(), HtmlError>
fn end_table_row(&mut self) -> Result<(), HtmlError>
fn start_table_cell(&mut self) -> Result<(), HtmlError>
fn end_table_cell(&mut self) -> Result<(), HtmlError>
fn start_emphasis(&mut self) -> Result<(), HtmlError>
fn end_emphasis(&mut self) -> Result<(), HtmlError>
fn start_strong(&mut self) -> Result<(), HtmlError>
fn end_strong(&mut self) -> Result<(), HtmlError>
fn start_strikethrough(&mut self) -> Result<(), HtmlError>
fn end_strikethrough(&mut self) -> Result<(), HtmlError>
fn start_link( &mut self, _link_type: LinkType, dest: &str, title: &str, ) -> Result<(), HtmlError>
fn end_link(&mut self) -> Result<(), HtmlError>
fn start_image<'a, I>( &mut self, _link_type: LinkType, dest: &str, title: &str, iter: &mut Peekable<I>, ) -> Result<(), HtmlError>
fn end_image(&mut self) -> Result<(), HtmlError>
fn footnote_reference(&mut self, name: &str) -> Result<(), HtmlError>
fn start_footnote_definition(&mut self, name: &str) -> Result<(), HtmlError>
fn end_footnote_definition(&mut self) -> Result<(), HtmlError>
fn task_list_item(&mut self, checked: bool) -> Result<(), HtmlError>
fn horizontal_rule(&mut self) -> Result<(), HtmlError>
fn soft_break(&mut self) -> Result<(), HtmlError>
fn hard_break(&mut self) -> Result<(), HtmlError>
fn text(&mut self, text: &str) -> Result<(), HtmlError>
fn start_definition_list(&mut self) -> Result<(), HtmlError>
fn end_definition_list(&mut self) -> Result<(), HtmlError>
fn start_definition_list_title(&mut self) -> Result<(), HtmlError>
fn end_definition_list_title(&mut self) -> Result<(), HtmlError>
fn start_definition_list_definition(&mut self) -> Result<(), HtmlError>
fn end_definition_list_definition(&mut self) -> Result<(), HtmlError>
fn start_metadata_block( &mut self, _metadata_type: &MetadataBlockKind, ) -> Result<(), HtmlError>
fn end_metadata_block(&mut self) -> Result<(), HtmlError>
fn html_raw(&mut self, html: &CowStr<'_>) -> Result<(), HtmlError>
fn collect_alt_text<'a, I>(&self, iter: &mut Peekable<I>) -> String
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.