Trait html5ever_ext::RcDomExt
[−]
[src]
pub trait RcDomExt: Sized + Minify { fn from_file_path_verified_and_stripped_of_comments_and_processing_instructions_and_with_a_sane_doc_type<P: AsRef<Path>>(
html_document_file_path: P
) -> Result<Self, HtmlError>; fn from_file_path<P: AsRef<Path>>(file_path: P) -> Result<Self, HtmlError>; fn verify(&self, context: &Path) -> Result<(), HtmlError>; fn recursively_strip_nodes_of_comments_and_processing_instructions_and_create_sane_doc_type(
&self,
context: &Path
) -> Result<(), HtmlError>; fn move_node_children_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
node: &Rc<Node>
); fn move_node_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
node: &Rc<Node>
); fn move_node_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
node: &Rc<Node>
); fn append_new_element_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
); fn append_new_element_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
); fn append_new_comment_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
comment: &str
); fn append_new_comment_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
comment: &str
); fn append_new_processing_instruction_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
target: &str,
data: &str
); fn append_new_processing_instruction_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
target: &str,
data: &str
); fn append_text_to_parent_node(&mut self, parent_node: &Rc<Node>, text: &str); fn append_text_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
text: &str
); }
This trait adds additional methods to a HTML DOM.
Required Methods
fn from_file_path_verified_and_stripped_of_comments_and_processing_instructions_and_with_a_sane_doc_type<P: AsRef<Path>>(
html_document_file_path: P
) -> Result<Self, HtmlError>
html_document_file_path: P
) -> Result<Self, HtmlError>
Creates an instance of an HTML DOM from a file path which is verified, stripped and with a sane DocType.
fn from_file_path<P: AsRef<Path>>(file_path: P) -> Result<Self, HtmlError>
Creates an instance of an HTML DOM from a file path
fn verify(&self, context: &Path) -> Result<(), HtmlError>
Verify that this HTML DOM is valid.
fn recursively_strip_nodes_of_comments_and_processing_instructions_and_create_sane_doc_type(
&self,
context: &Path
) -> Result<(), HtmlError>
&self,
context: &Path
) -> Result<(), HtmlError>
Remove all comments and processing instructions and make the DOCTYPE a simple 'html' (for HTML 5).
fn move_node_children_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
node: &Rc<Node>
)
&mut self,
parent_node: &Rc<Node>,
node: &Rc<Node>
)
Moves a node's children to another parent node
fn move_node_to_parent_node(&mut self, parent_node: &Rc<Node>, node: &Rc<Node>)
Moves an existing element node to a parent node
fn move_node_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
node: &Rc<Node>
)
&mut self,
sibling_node: &Rc<Node>,
node: &Rc<Node>
)
Moves an existing element before a sibling node
fn append_new_element_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
)
&mut self,
parent_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
)
Appends a new element node to a parent node
fn append_new_element_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
)
&mut self,
sibling_node: &Rc<Node>,
qualified_name: QualName,
attributes: Vec<Attribute>
)
Appends a new element before a sibling node
fn append_new_comment_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
comment: &str
)
&mut self,
parent_node: &Rc<Node>,
comment: &str
)
Appends a new comment node to a parent node
fn append_new_comment_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
comment: &str
)
&mut self,
sibling_node: &Rc<Node>,
comment: &str
)
Appends a new comment before a sibling node
fn append_new_processing_instruction_to_parent_node(
&mut self,
parent_node: &Rc<Node>,
target: &str,
data: &str
)
&mut self,
parent_node: &Rc<Node>,
target: &str,
data: &str
)
Appends a new processing instruction node to a parent node
fn append_new_processing_instruction_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
target: &str,
data: &str
)
&mut self,
sibling_node: &Rc<Node>,
target: &str,
data: &str
)
Appends a new processing instruction before a sibling node
fn append_text_to_parent_node(&mut self, parent_node: &Rc<Node>, text: &str)
Appends a text node to a parent node
fn append_text_before_sibling_node(
&mut self,
sibling_node: &Rc<Node>,
text: &str
)
&mut self,
sibling_node: &Rc<Node>,
text: &str
)
Appends a text node before a sibling node
Implementors
impl RcDomExt for RcDom