pub struct DefaultHtmlWriter<W: StrWrite> { /* private fields */ }
Expand description
An HTML writer implementation. This type implements methods for writing HTML elements. Default HTML writer implementation that can work with any StrWrite-compatible writer This should be the approximate amount of code any custom implementation needs to provide
Implementations§
Source§impl<W: StrWrite> DefaultHtmlWriter<W>
impl<W: StrWrite> DefaultHtmlWriter<W>
Sourcepub fn new(writer: W, config: HtmlConfig) -> Self
pub fn new(writer: W, config: HtmlConfig) -> Self
Create a new DefaultHtmlWriter with the given writer and configuration
Trait Implementations§
Source§impl<W: StrWrite> HtmlWriter<W> for DefaultHtmlWriter<W>
impl<W: StrWrite> HtmlWriter<W> for DefaultHtmlWriter<W>
fn get_writer(&mut self) -> &mut W
fn get_config(&self) -> &HtmlConfig
fn get_state(&mut self) -> &mut HtmlState
Source§fn write_str(&mut self, s: &str) -> Result<(), HtmlError>
fn write_str(&mut self, s: &str) -> Result<(), HtmlError>
Write a string directly to the output
Source§fn write_attributes(&mut self, element: &str) -> Result<(), HtmlError>
fn write_attributes(&mut self, element: &str) -> Result<(), HtmlError>
Write HTML attributes for a given element
Source§fn 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
Auto Trait Implementations§
impl<W> Freeze for DefaultHtmlWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for DefaultHtmlWriter<W>where
W: RefUnwindSafe,
impl<W> Send for DefaultHtmlWriter<W>where
W: Send,
impl<W> Sync for DefaultHtmlWriter<W>where
W: Sync,
impl<W> Unpin for DefaultHtmlWriter<W>where
W: Unpin,
impl<W> UnwindSafe for DefaultHtmlWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more