Struct html5ever_ext::UnattachedNode
[−]
[src]
pub struct UnattachedNode { pub local_name: LocalName, pub attributes: Vec<Attribute>, pub children: Vec<Either<String, UnattachedNode>>, }
Represents the structure of nodes unattached to a DOM. Designed to make it easy to create an entire graph of nodes before adding it.
Fields
local_name: LocalName
Local name of this node
attributes: Vec<Attribute>
Attributes of this node
children: Vec<Either<String, UnattachedNode>>
The children of this node
Methods
impl UnattachedNode
[src]
pub fn to_html5_rc_dom(self) -> RcDom
[src]
Creates a HTML RcDom from this node as the 'html' root with a HTML5 DOCTYPE preceding it. Panics if the node is not called 'html'.
pub fn to_html5_document(
self,
html_head_and_body_tags_are_optional: bool
) -> String
[src]
self,
html_head_and_body_tags_are_optional: bool
) -> String
Creates a HTML document as a String from this node as the 'html' root with a HTML5 DOCTYPE preceding it. Panics if the node is not called 'html'.
pub fn empty(local_name: LocalName) -> Self
[src]
Represents an empty element, such as
pub fn with_attributes(
local_name: LocalName,
attributes: Vec<Attribute>
) -> Self
[src]
local_name: LocalName,
attributes: Vec<Attribute>
) -> Self
Represents an empty element with just attributes, such as
pub fn with_attributes_and_text<S: Into<String>>(
local_name: LocalName,
attributes: Vec<Attribute>,
text: S
) -> Self
[src]
local_name: LocalName,
attributes: Vec<Attribute>,
text: S
) -> Self
Represents an empty element with just attributes and text, such as
pub fn with_text<S: Into<String>>(local_name: LocalName, text: S) -> Self
[src]
Represents an empty element with just text, such as hello
pub fn with_empty_attribute(self, name: &str) -> Self
[src]
Add an empty attribute.
pub fn with_id_attribute(self, id: &str) -> Self
[src]
Add an id attribute.
pub fn with_title_attribute(self, title: &str) -> Self
[src]
Add a title attribute.
pub fn with_accesskey_attribute(self, accesskey: &str) -> Self
[src]
Add an accesskey attribute.
pub fn with_lang_attribute(self, lang: &str) -> Self
[src]
Add a lang attribute.
pub fn with_contenteditable_attribute(self, editable: bool) -> Self
[src]
Add a contenteditable attribute.
pub fn with_spellcheck_attribute(self, spellcheck: bool) -> Self
[src]
Add a spellcheck attribute.
pub fn with_tabindex_attribute(self, tabindex: i32) -> Self
[src]
Add a tabindex attribute.
[src]
Add a hidden attribute.
[src]
Add a contextmenu attribute.
pub fn with_data_attribute(self, name: &str, value: &str) -> Self
[src]
Add a data attribute.
pub fn with_draggable_attribute(self, draggable: Draggable) -> Self
[src]
Add a draggable attribute.
pub fn with_dir_attribute(self, dir: Dir) -> Self
[src]
Add a dir attribute.
pub fn with_href_attribute(self, href: &str) -> Self
[src]
Add a href attribute.
pub fn with_class_attribute(self, classes: &str) -> Self
[src]
Add a class attribute.
pub fn with_role_attribute(self, role: AriaRole) -> Self
[src]
Add a class attribute.
pub fn with_class_attribute_from_classes<S: Deref<Target = str>>(
self,
classes: &[S]
) -> Self
[src]
self,
classes: &[S]
) -> Self
Add a class attribute from classes
pub fn with_classes<S: Deref<Target = str>>(self, classes: &[S]) -> Self
[src]
Add classes irrespective of whether a class attribute exists or not.
pub fn with_class(self, value: &str) -> Self
[src]
Add a class attribute if it does not exist, or appends to an existing class attribute if it does
pub fn with_attribute(self, attribute: Attribute) -> Self
[src]
Add an attribute.
pub fn with_child_element(self, child_element: UnattachedNode) -> Self
[src]
Add a child element.
pub fn with_child_text<S: Into<String>>(self, child_text: S) -> Self
[src]
Add a child text. If there is an existing child text element, appends its text to it.
pub fn attach_to_document_node(self, rc_dom: &mut RcDom) -> Rc<Node>
[src]
Attach this node as a child of the document_node (ie as a root node)
pub fn attach_to_parent_node(
self,
rc_dom: &mut RcDom,
parent_node: &Rc<Node>
) -> Rc<Node>
[src]
self,
rc_dom: &mut RcDom,
parent_node: &Rc<Node>
) -> Rc<Node>
Attach this node as a child of parent_node
pub fn attach_to_before_sibling_node(
self,
rc_dom: &mut RcDom,
sibling_node: &Rc<Node>
) -> Rc<Node>
[src]
self,
rc_dom: &mut RcDom,
sibling_node: &Rc<Node>
) -> Rc<Node>
Attach this node before the sibling_node
Trait Implementations
impl Debug for UnattachedNode
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for UnattachedNode
[src]
fn clone(&self) -> UnattachedNode
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more