Struct html2text::render::text_renderer::PlainDecorator
source · pub struct PlainDecorator { /* private fields */ }
Expand description
A decorator for use with SubRenderer
which outputs plain UTF-8 text
with no annotations. Markup is rendered as text characters or footnotes.
Implementations§
source§impl PlainDecorator
impl PlainDecorator
sourcepub fn new() -> PlainDecorator
pub fn new() -> PlainDecorator
Create a new PlainDecorator
.
Trait Implementations§
source§impl Clone for PlainDecorator
impl Clone for PlainDecorator
source§fn clone(&self) -> PlainDecorator
fn clone(&self) -> PlainDecorator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PlainDecorator
impl Debug for PlainDecorator
source§impl TextDecorator for PlainDecorator
impl TextDecorator for PlainDecorator
§type Annotation = ()
type Annotation = ()
An annotation which can be added to text, and which will
be attached to spans of text.
source§fn decorate_link_start(&mut self, _url: &str) -> (String, Self::Annotation)
fn decorate_link_start(&mut self, _url: &str) -> (String, Self::Annotation)
Return an annotation and rendering prefix for a link.
source§fn decorate_link_end(&mut self) -> String
fn decorate_link_end(&mut self) -> String
Return a suffix for after a link.
source§fn decorate_em_start(&self) -> (String, Self::Annotation)
fn decorate_em_start(&self) -> (String, Self::Annotation)
Return an annotation and rendering prefix for em
source§fn decorate_em_end(&self) -> String
fn decorate_em_end(&self) -> String
Return a suffix for after an em.
source§fn decorate_strong_start(&self) -> (String, Self::Annotation)
fn decorate_strong_start(&self) -> (String, Self::Annotation)
Return an annotation and rendering prefix for strong
source§fn decorate_strong_end(&self) -> String
fn decorate_strong_end(&self) -> String
Return a suffix for after a strong.
source§fn decorate_strikeout_start(&self) -> (String, Self::Annotation)
fn decorate_strikeout_start(&self) -> (String, Self::Annotation)
Return an annotation and rendering prefix for strikeout
source§fn decorate_strikeout_end(&self) -> String
fn decorate_strikeout_end(&self) -> String
Return a suffix for after a strikeout.
source§fn decorate_code_start(&self) -> (String, Self::Annotation)
fn decorate_code_start(&self) -> (String, Self::Annotation)
Return an annotation and rendering prefix for code
source§fn decorate_code_end(&self) -> String
fn decorate_code_end(&self) -> String
Return a suffix for after a code.
source§fn decorate_preformat_first(&self) -> Self::Annotation
fn decorate_preformat_first(&self) -> Self::Annotation
Return an annotation for the initial part of a preformatted line
source§fn decorate_preformat_cont(&self) -> Self::Annotation
fn decorate_preformat_cont(&self) -> Self::Annotation
Return an annotation for a continuation line when a preformatted
line doesn’t fit.
source§fn decorate_image(
&mut self,
_src: &str,
title: &str
) -> (String, Self::Annotation)
fn decorate_image( &mut self, _src: &str, title: &str ) -> (String, Self::Annotation)
Return an annotation and rendering prefix for a link.
source§fn header_prefix(&self, level: usize) -> String
fn header_prefix(&self, level: usize) -> String
Return prefix string of header in specific level.
source§fn quote_prefix(&self) -> String
fn quote_prefix(&self) -> String
Return prefix string of quoted block.
source§fn unordered_item_prefix(&self) -> String
fn unordered_item_prefix(&self) -> String
Return prefix string of unordered list item.
source§fn ordered_item_prefix(&self, i: i64) -> String
fn ordered_item_prefix(&self, i: i64) -> String
Return prefix string of ith ordered list item.
source§fn finalise(&mut self, links: Vec<String>) -> Vec<TaggedLine<()>>
fn finalise(&mut self, links: Vec<String>) -> Vec<TaggedLine<()>>
Finish with a document, and return extra lines (eg footnotes)
to add to the rendered text.
source§fn make_subblock_decorator(&self) -> Self
fn make_subblock_decorator(&self) -> Self
Return a new decorator of the same type which can be used
for sub blocks.
source§fn push_colour(&mut self, _: Colour) -> Option<Self::Annotation>
fn push_colour(&mut self, _: Colour) -> Option<Self::Annotation>
Return an annotation corresponding to adding colour, or none.
source§fn pop_colour(&mut self) -> bool
fn pop_colour(&mut self) -> bool
Pop the last colour pushed if we pushed one.
source§fn push_bgcolour(&mut self, _: Colour) -> Option<Self::Annotation>
fn push_bgcolour(&mut self, _: Colour) -> Option<Self::Annotation>
Return an annotation corresponding to adding background colour, or none.
source§fn pop_bgcolour(&mut self) -> bool
fn pop_bgcolour(&mut self) -> bool
Pop the last background colour pushed if we pushed one.
source§fn decorate_superscript_start(&self) -> (String, Self::Annotation)
fn decorate_superscript_start(&self) -> (String, Self::Annotation)
Return an annotation and rendering prefix for superscript text
source§fn decorate_superscript_end(&self) -> String
fn decorate_superscript_end(&self) -> String
Return a suffix for after a superscript.
Auto Trait Implementations§
impl Freeze for PlainDecorator
impl !RefUnwindSafe for PlainDecorator
impl !Send for PlainDecorator
impl !Sync for PlainDecorator
impl Unpin for PlainDecorator
impl !UnwindSafe for PlainDecorator
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