Struct html2text::render::text_renderer::RichDecorator
source · pub struct RichDecorator {}
Expand description
A decorator to generate rich text (styled) rather than pure text output.
Implementations§
source§impl RichDecorator
impl RichDecorator
sourcepub fn new() -> RichDecorator
pub fn new() -> RichDecorator
Create a new RichDecorator
.
Trait Implementations§
source§impl Clone for RichDecorator
impl Clone for RichDecorator
source§fn clone(&self) -> RichDecorator
fn clone(&self) -> RichDecorator
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 RichDecorator
impl Debug for RichDecorator
source§impl TextDecorator for RichDecorator
impl TextDecorator for RichDecorator
§type Annotation = RichAnnotation
type Annotation = RichAnnotation
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<RichAnnotation>>
fn finalise(&mut self, _links: Vec<String>) -> Vec<TaggedLine<RichAnnotation>>
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: Colour) -> Option<Self::Annotation>
fn push_colour(&mut self, colour: 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: Colour) -> Option<Self::Annotation>
fn push_bgcolour(&mut self, colour: 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 RichDecorator
impl RefUnwindSafe for RichDecorator
impl Send for RichDecorator
impl Sync for RichDecorator
impl Unpin for RichDecorator
impl UnwindSafe for RichDecorator
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