[−][src]Struct cursive_markup::html::Renderer
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]
fn render(&self, constraint: XY<usize>) -> RenderedDocument
[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,
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,
C: Unpin,
D: Unpin,
impl<D, C> UnwindSafe for Renderer<D, C> where
C: UnwindSafe,
D: UnwindSafe,
C: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.