Trait build_html::Html[][src]

pub trait Html: Debug {
    fn to_html_string(&self) -> String;
}
Expand description

An element that can be converted to an HTML string

This trait is the centerpiece of the entire library: after building up an HTML structure, usually an HtmlPage, to_html_string() is used to flush the structure to a string.

Required methods

Convert this element into an HTML string

This is the method that ultimately flushes each HTML object to a string.

Example

let html = Container::default()
    .add_paragraph("My p element")
    .to_html_string();

assert_eq!(html, "<div><p>My p element</p></div>")

Trait Implementations

Formats the value using the given formatter. Read more

Implementors