[][src]Struct cursive_markup::html::Renderer

pub struct Renderer<D: TextDecorator + Clone, C: Converter<D::Annotation>> { /* fields omitted */ }

A renderer for HTML documents.

This renderer uses html2text to parse and render an HTML document. The provided document is only parsed once: when the instance is constructed. Then it is rendered every time the width of the view changes.

You can custommize the renderer by settting a custom TextDecorator and Converter. The TextDecorator is used by html2text to convert the HTML DOM into annotated strings. The Converter is used by the renderer to interpret the annotations and to extract the text format and links.

Per default, the renderer uses the RichDecorator and the RichConverter.

Implementations

impl Renderer<RichDecorator, RichConverter>[src]

pub fn new(html: &str) -> Renderer<RichDecorator, RichConverter>[src]

Creates a new renderer for the given HTML document using the default settings.

impl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer<D, C>[src]

pub fn custom(html: &str, decorator: D, converter: C) -> Renderer<D, C>[src]

Creates a new renderer for the given HTML document using a custom decorator and converter.

Trait Implementations

impl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer for Renderer<D, C>[src]

Auto Trait Implementations

impl<D, C> !RefUnwindSafe for Renderer<D, C>

impl<D, C> Send for Renderer<D, C> where
    C: Send,
    D: Send

impl<D, C> !Sync for Renderer<D, C>

impl<D, C> Unpin for Renderer<D, C> where
    C: Unpin,
    D: Unpin

impl<D, C> UnwindSafe for Renderer<D, C> where
    C: UnwindSafe,
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> With for T