Trait used to generate HTML from Rust structures
It contains the following optional definitions:
// Defaults to an empty string
// Defaults to empty vec
// Defaults to empty vec
The following method should not need to be implemented:
// Calls `as_raw_html` for each of the items returned by `inner_html`
The following definition also should not need to be implemented, but may on occasion be useful to override:
The web-sys feature may be enabled to allow access to the following default function:
The yew feature may be enabled to allow access to the following default function:
There are 3 other tools included in this crate:
- An
Htmlifyimplementation for&str. This is a special case which simply returns the string itself whenas_raw_htmlis called, and returnsNonewhenas_elementis called. This is so text-content "leaves" can be represented. (and the default implementation ofas_elementunderstands this). - An
Attributestruct to store key-value pairs as strings, used specifically for element attributes. These useCow<'static, str>to leave optimization details up to the implementor. - The
web-sysfeature also provides access to anappend_to_document_bodyfunction which takes anyimpl Htmlifyand attempts to append it to the document body (through web_sys calls). This is here purely for convenience.