Struct virtual_node::SpecialAttributes[][src]

pub struct SpecialAttributes {
    pub on_create_elem: Option<(u32, EventAttribFn)>,
    pub dangerous_inner_html: Option<String>,
}
Expand description

A specially supported attributes.

Fields

on_create_elem: Option<(u32, EventAttribFn)>

A function that gets called when the virtual node is first turned into a real node, or when this virtual node’s attribute’s replace some other existing node with the same tag.

The on_create_elem attribute has a unique identifier so that when we patch over another DOM element that also has an on_create_elem we know that we still need to call on_create_elem.

Examples

use virtual_node::wrap_closure;

let mut node = VirtualNode::element("div");
let on_create_elem =move |_elem: web_sys::Element| {
};

node.as_velement_mut().unwrap().special_attributes.on_create_elem =
    Some((12345, wrap_closure(on_create_elem)));
dangerous_inner_html: Option<String>

Allows setting the innerHTML of an element. Be sure to escape all untrusted input to avoid cross site scripting attacks.

Implementations

If there is an on_create_elem function defined, call it.

Trait Implementations

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.