This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.

Type Alias Html

Source
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

Source

pub fn key(&self) -> Option<&Key>

Source

pub fn has_key(&self) -> bool

Returns true if the VNode has a key.

Source

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.

Source

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

Source§

fn from(val: ChildrenRenderer<Html>) -> Self

Converts to this type from the input type.
Source§

impl IntoHtmlResult for Html

Source§

fn into_html_result(self) -> HtmlResult

Performs the conversion.
Source§

impl Clone for VNode

Source§

fn clone(&self) -> VNode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VNode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: ToString> From<T> for VNode

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<COMP> From<VChild<COMP>> for VNode
where COMP: BaseComponent,

Source§

fn from(vchild: VChild<COMP>) -> Self

Converts to this type from the input type.
Source§

impl From<VComp> for VNode

Source§

fn from(vcomp: VComp) -> Self

Converts to this type from the input type.
Source§

impl From<VList> for VNode

Source§

fn from(vlist: VList) -> Self

Converts to this type from the input type.
Source§

impl From<VPortal> for VNode

Source§

fn from(vportal: VPortal) -> Self

Converts to this type from the input type.
Source§

impl From<VSuspense> for VNode

Source§

fn from(vsuspense: VSuspense) -> Self

Converts to this type from the input type.
Source§

impl From<VTag> for VNode

Source§

fn from(vtag: VTag) -> Self

Converts to this type from the input type.
Source§

impl From<VText> for VNode

Source§

fn from(vtext: VText) -> Self

Converts to this type from the input type.
Source§

impl<A: Into<VNode>> FromIterator<A> for VNode

Source§

fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl ImplicitClone for VNode

§

fn implicit_clone(&self) -> Self

This function is not magic; it is literally defined as Read more
Source§

impl IntoPropValue<ChildrenRenderer<VNode>> for VNode

Source§

fn into_prop_value(self) -> ChildrenRenderer<VNode>

Convert self to a value of a Properties struct.
Source§

impl PartialEq for VNode

Source§

fn eq(&self, other: &VNode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for VNode