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

source

pub fn new() -> PlainDecorator

Create a new PlainDecorator.

Trait Implementations§

source§

impl Clone for PlainDecorator

source§

fn clone(&self) -> PlainDecorator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PlainDecorator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TextDecorator for PlainDecorator

§

type Annotation = ()

An annotation which can be added to text, and which will be attached to spans of text.
Return an annotation and rendering prefix for a link.
Return a suffix for after a link.
source§

fn decorate_em_start(&self) -> (String, Self::Annotation)

Return an annotation and rendering prefix for em
source§

fn decorate_em_end(&self) -> String

Return a suffix for after an em.
source§

fn decorate_strong_start(&self) -> (String, Self::Annotation)

Return an annotation and rendering prefix for strong
source§

fn decorate_strong_end(&self) -> String

Return a suffix for after a strong.
source§

fn decorate_strikeout_start(&self) -> (String, Self::Annotation)

Return an annotation and rendering prefix for strikeout
source§

fn decorate_strikeout_end(&self) -> String

Return a suffix for after a strikeout.
source§

fn decorate_code_start(&self) -> (String, Self::Annotation)

Return an annotation and rendering prefix for code
source§

fn decorate_code_end(&self) -> String

Return a suffix for after a code.
source§

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

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)

Return an annotation and rendering prefix for a link.
source§

fn header_prefix(&self, level: usize) -> String

Return prefix string of header in specific level.
source§

fn quote_prefix(&self) -> String

Return prefix string of quoted block.
source§

fn unordered_item_prefix(&self) -> String

Return prefix string of unordered list item.
source§

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<()>>

Finish with a document, and return extra lines (eg footnotes) to add to the rendered text.
source§

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>

Return an annotation corresponding to adding colour, or none.
source§

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>

Return an annotation corresponding to adding background colour, or none.
source§

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)

Return an annotation and rendering prefix for superscript text
source§

fn decorate_superscript_end(&self) -> String

Return a suffix for after a superscript.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.