pub type Html = VNode;
Expand description
A type which expected as a result of view
function implementation.
Aliased Type§
enum Html {
// some variants omitted
}
Variants§
Implementations
Source§impl VNode
impl VNode
pub fn key(&self) -> Option<&Key>
Sourcepub fn to_vlist_mut(&mut self) -> &mut VList
pub fn to_vlist_mut(&mut self) -> &mut VList
Acquires a mutable reference of current VNode as a VList.
Creates a VList with the current node as the first child if current VNode is not a VList.
Sourcepub fn from_html_unchecked(html: AttrValue) -> Self
pub fn from_html_unchecked(html: AttrValue) -> Self
Create a VNode
from a string of HTML
§Behavior in browser
In the browser, this function creates an element with the same XML namespace as the parent,
sets the passed HTML to its innerHTML
and inserts the contents of it into the DOM.
§Behavior on server
When rendering on the server, the contents of HTML are directly injected into the HTML stream.
§Warning
The contents are not sanitized or validated. You, as the developer, are responsible to ensure the HTML string passed to this method are valid and not malicious
§Example
use yew::{html, AttrValue, Html};
let parsed = Html::from_html_unchecked(AttrValue::from("<div>content</div>"));
let _: Html = html! {
<div>
{parsed}
</div>
};
Trait Implementations§
Source§impl From<ChildrenRenderer<VNode>> for Html
impl From<ChildrenRenderer<VNode>> for Html
Source§fn from(val: ChildrenRenderer<Html>) -> Self
fn from(val: ChildrenRenderer<Html>) -> Self
Converts to this type from the input type.
Source§impl IntoHtmlResult for Html
impl IntoHtmlResult for Html
Source§fn into_html_result(self) -> HtmlResult
fn into_html_result(self) -> HtmlResult
Performs the conversion.
Source§impl<A: Into<VNode>> FromIterator<A> for VNode
impl<A: Into<VNode>> FromIterator<A> for VNode
Source§fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl ImplicitClone for VNode
impl ImplicitClone for VNode
§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
This function is not magic; it is literally defined as Read more
Source§impl IntoPropValue<ChildrenRenderer<VNode>> for VNode
impl IntoPropValue<ChildrenRenderer<VNode>> for VNode
Source§fn into_prop_value(self) -> ChildrenRenderer<VNode>
fn into_prop_value(self) -> ChildrenRenderer<VNode>
Convert
self
to a value of a Properties
struct.