Struct sauron_core::dom::CreatedNode
source · [−]pub struct CreatedNode {
pub node: Node,
/* private fields */
}
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
sourceimpl CreatedNode
impl CreatedNode
sourcepub fn without_closures(node: Node) -> Self
pub fn without_closures(node: Node) -> Self
create a simple node with no closure attache
sourcepub fn create_text_node(txt: &str) -> Text
pub fn create_text_node(txt: &str) -> Text
create a text node
sourcepub fn create_dom_node<DSP, MSG>(
program: &DSP,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>
) -> CreatedNode where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
pub fn create_dom_node<DSP, MSG>(
program: &DSP,
vnode: &Node<MSG>,
focused_node: &mut Option<Node>
) -> 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.
sourcepub fn set_element_attributes<DSP, MSG>(
program: &DSP,
closures: &mut HashMap<usize, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attrs: &[&Attribute<MSG>]
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
pub fn set_element_attributes<DSP, MSG>(
program: &DSP,
closures: &mut HashMap<usize, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attrs: &[&Attribute<MSG>]
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
set the element attribute
sourcepub fn set_element_attribute<DSP, MSG>(
program: &DSP,
closures: &mut HashMap<usize, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attr: &Attribute<MSG>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
pub fn set_element_attribute<DSP, MSG>(
program: &DSP,
closures: &mut HashMap<usize, Vec<(&'static str, Closure<dyn FnMut(Event)>)>>,
element: &Element,
attr: &Attribute<MSG>
) where
MSG: 'static,
DSP: Clone + Dispatch<MSG> + 'static,
set the element attribute
Note: this is called in a loop, so setting the attributes, and style will not be on the same call, but on a subsequent call to each other. Using the if-else-if here for attributes, style, function_call.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more