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

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

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

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

Trait Implementations

Renders this document within the given size constraint and returns the result. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.