Struct sauron::CreatedNode [−][src]
pub struct CreatedNode { pub node: Node, // some fields omitted }
Expand description
A node along with all of the closures that were created for that node’s events and all of it’s child node’s events.
Fields
node: Node
A Node
or Element
that was created from a Node
Implementations
create a simple node with no closure attache
create a text node
create an element node
Create and return a CreatedNode
instance (containing a DOM Node
together with potentially related closures) for this virtual node.
TODO: Optimization for apply_patches::find_nodes Keep track of the Node with their corresponding NodeIdx, so as not to traverse all of them to find the node. We can maintain a HashMap<NodeIdx, web_sys::Node>
pub fn set_element_attributes<DSP, MSG>(
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event) + 'static>), Global>, RandomState>,
element: &Element,
attrs: &[&Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>>]
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
pub fn set_element_attributes<DSP, MSG>(
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event) + 'static>), Global>, RandomState>,
element: &Element,
attrs: &[&Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>>]
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
set the element attribute
pub fn set_element_attribute<DSP, MSG>(
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event) + 'static>), Global>, RandomState>,
element: &Element,
attr: &Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
pub fn set_element_attribute<DSP, MSG>(
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event) + 'static>), Global>, RandomState>,
element: &Element,
attr: &Attribute<&'static str, &'static str, AttributeValue, Callback<Event, MSG>>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
set the element attribute