Struct cursive_markup::html::Renderer
source · [−]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
sourceimpl Renderer<RichDecorator, RichConverter>
impl Renderer<RichDecorator, RichConverter>
sourcepub fn new(html: &str) -> Renderer<RichDecorator, RichConverter>
pub fn new(html: &str) -> Renderer<RichDecorator, RichConverter>
Creates a new renderer for the given HTML document using the default settings.
sourceimpl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer<D, C>
impl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer<D, C>
Trait Implementations
sourceimpl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer for Renderer<D, C>
impl<D: TextDecorator + Clone, C: Converter<D::Annotation>> Renderer for Renderer<D, C>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more