[−][src]Struct sauron_core::dom::CreatedNode
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
impl CreatedNode
[src]
pub fn without_closures(node: Node) -> Self
[src]
create a simple node with no closure attache
pub fn create_text_node(txt: &str) -> Text
[src]
create a text node
pub fn create_dom_node<DSP, MSG>(
program: &DSP,
node_idx_lookup: &mut HashMap<NodeIdx, Node>,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>,
node_idx: &mut Option<NodeIdx>
) -> CreatedNode where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
[src]
program: &DSP,
node_idx_lookup: &mut HashMap<NodeIdx, Node>,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>,
node_idx: &mut Option<NodeIdx>
) -> CreatedNode where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
create an element node
pub fn create_dom_node_opt<DSP, MSG>(
program: Option<&DSP>,
node_idx_lookup: &mut HashMap<NodeIdx, Node>,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>,
node_idx: &mut Option<NodeIdx>
) -> CreatedNode where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
[src]
program: Option<&DSP>,
node_idx_lookup: &mut HashMap<NodeIdx, Node>,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>,
node_idx: &mut Option<NodeIdx>
) -> CreatedNode where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
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)>)>>,
element: &Element,
attrs: &[&Attribute<MSG>]
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
[src]
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attrs: &[&Attribute<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)>)>>,
element: &Element,
attr: &Attribute<MSG>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
[src]
program: Option<&DSP>,
closures: &mut HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attr: &Attribute<MSG>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
set the element attribute
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CreatedNode
impl !Send for CreatedNode
impl !Sync for CreatedNode
impl Unpin for CreatedNode
impl !UnwindSafe for CreatedNode
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,