pub type Node = Rc<Node>;
Expand description
A HTML5 node.
Aliased Type§
pub struct Node { /* private fields */ }
Trait Implementations§
Source§impl NodeExt for Node
impl NodeExt for Node
Source§fn append_children(&self, children: Vec<Node>)
fn append_children(&self, children: Vec<Node>)
Appends the given children to the node.
Source§fn append_child(&self, child: Node)
fn append_child(&self, child: Node)
Appends the given child to the node.
Source§fn attr(self, name: &str, value: &str) -> Self
fn attr(self, name: &str, value: &str) -> Self
Adds an Attribute with given name and value to the node. Read more
Source§fn borrow_attr(&self, name: &str, value: &str)
fn borrow_attr(&self, name: &str, value: &str)
Adds an Attribute with given name and value to the node without consuming self. Read more
Source§fn attrs(self, attributes: Vec<(&str, &str)>) -> Self
fn attrs(self, attributes: Vec<(&str, &str)>) -> Self
Adds a list of attributes to the node. Read more
Source§fn borrow_attrs(&self, attributes: Vec<(&str, &str)>)
fn borrow_attrs(&self, attributes: Vec<(&str, &str)>)
Adds a list of attributes to the node without consuming self. Read more
Source§fn find_attribute(&self, attribute_name: &str) -> Option<usize>
fn find_attribute(&self, attribute_name: &str) -> Option<usize>
Returns the attribute index if present.
Source§fn attribute_eq(&self, attribute_name: &str, value: &str) -> bool
fn attribute_eq(&self, attribute_name: &str, value: &str) -> bool
Checks if the given attribute matches the value.
Source§fn add_class(&self, class_value: &str)
fn add_class(&self, class_value: &str)
Adds
value
to the class
attribute. Adds the class
attribute if
it is not present.Source§fn remove_class(&self, class_value: &str)
fn remove_class(&self, class_value: &str)
Removes the given
value
from the class
attribute.Source§fn toggle_class(&self, class_value: &str)
fn toggle_class(&self, class_value: &str)
Toggles the given
value
of the class
attribute. Creates the class
attribute if not set yet.Source§fn remove_attribute(&self, name: &str)
fn remove_attribute(&self, name: &str)
Removes the attribute with the given
name
. Does nothing
if the attribute does not exist. This method does not compare its
values.