pub struct DomNode { /* private fields */ }
Expand description
A counter part of the vdom Node This is needed, so that we can
- Keep track of event closure and drop them when nodes has been removed
- Custom removal of children nodes on a stateful component
Implementations§
source§impl DomNode
impl DomNode
sourcepub fn is_element(&self) -> bool
pub fn is_element(&self) -> bool
returns true if this an element node
sourcepub fn is_fragment(&self) -> bool
pub fn is_fragment(&self) -> bool
returns true if this a fragment node
sourcepub fn is_text_node(&self) -> bool
pub fn is_text_node(&self) -> bool
returns true if this a text node
sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
returns true if this Comment node
sourcepub fn is_stateful_component(&self) -> bool
pub fn is_stateful_component(&self) -> bool
returns true if this is a stateful component
sourcepub fn as_element(&self) -> Element
pub fn as_element(&self) -> Element
exposed the underlying wrapped node as web_sys::Element
sourcepub fn outer_html(&self) -> String
pub fn outer_html(&self) -> String
return the outer html string of an element
sourcepub fn append_children(&self, for_append: Vec<DomNode>)
pub fn append_children(&self, for_append: Vec<DomNode>)
append the DomNode child
into this DomNode self
sourcepub fn set_dom_attrs(
&self,
attrs: impl IntoIterator<Item = DomAttr>
) -> Result<(), JsValue>
pub fn set_dom_attrs( &self, attrs: impl IntoIterator<Item = DomAttr> ) -> Result<(), JsValue>
set the attributes of the dom element
sourcepub fn set_dom_attr(&self, attr: DomAttr) -> Result<(), JsValue>
pub fn set_dom_attr(&self, attr: DomAttr) -> Result<(), JsValue>
set the attribute of the dom element
sourcepub fn render_to_string(&self) -> String
pub fn render_to_string(&self) -> String
render this DomNode into an html string represenation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DomNode
impl !RefUnwindSafe for DomNode
impl !Send for DomNode
impl !Sync for DomNode
impl Unpin for DomNode
impl !UnwindSafe for DomNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more