pub trait Htmlify {
// Provided methods
fn tag(&self) -> Cow<'static, str> { ... }
fn attributes(&self) -> Vec<Attribute> { ... }
fn inner_html(&self) -> Vec<Box<dyn Htmlify>> { ... }
fn inner_html_as_string(&self) -> String { ... }
fn as_raw_html(&self) -> String { ... }
fn as_element(&self) -> Option<Element> { ... }
fn as_yew_node(&self) -> Html { ... }
}
Expand description
Trait used to generate HTML from Rust structures. See module-level documentation for more details.
Provided Methods§
Sourcefn tag(&self) -> Cow<'static, str>
fn tag(&self) -> Cow<'static, str>
Sets the HTML tag associated when converting this to an element.
Sourcefn attributes(&self) -> Vec<Attribute>
fn attributes(&self) -> Vec<Attribute>
Sets the attributes to include when converting this to an element.
Sourcefn inner_html(&self) -> Vec<Box<dyn Htmlify>>
fn inner_html(&self) -> Vec<Box<dyn Htmlify>>
Get the inner HTML
Sourcefn inner_html_as_string(&self) -> String
fn inner_html_as_string(&self) -> String
Stringifies the inner HTML
Sourcefn as_raw_html(&self) -> String
fn as_raw_html(&self) -> String
Convert this to a raw string of HTML
Sourcefn as_element(&self) -> Option<Element>
fn as_element(&self) -> Option<Element>
Convert this into a web_sys::Element
Sourcefn as_yew_node(&self) -> Html
fn as_yew_node(&self) -> Html
Convert this into ::yew::Html