Struct html5ever_ext::RcDom
[−]
pub struct RcDom { pub document: Rc<Node>, pub errors: Vec<Cow<'static, str>>, pub quirks_mode: QuirksMode, }
The DOM itself; the result of parsing.
Fields
document: Rc<Node>
The Document
itself.
errors: Vec<Cow<'static, str>>
Errors that occurred during parsing.
quirks_mode: QuirksMode
The document's quirks mode.
Trait Implementations
impl TreeSink for RcDom
type Output = RcDom
fn finish(self) -> RcDom
type Handle = Rc<Node>
fn parse_error(&mut self, msg: Cow<'static, str>)
fn get_document(&mut self) -> Rc<Node>
fn get_template_contents(&mut self, target: &Rc<Node>) -> Rc<Node>
fn set_quirks_mode(&mut self, mode: QuirksMode)
fn same_node(&self, x: &Rc<Node>, y: &Rc<Node>) -> bool
fn elem_name(&self, target: &'a Rc<Node>) -> ExpandedName<'a>
fn create_element(
&mut self,
name: QualName,
attrs: Vec<Attribute>,
flags: ElementFlags
) -> Rc<Node>
&mut self,
name: QualName,
attrs: Vec<Attribute>,
flags: ElementFlags
) -> Rc<Node>
fn create_comment(&mut self, text: Tendril<UTF8, NonAtomic>) -> Rc<Node>
fn create_pi(
&mut self,
target: Tendril<UTF8, NonAtomic>,
data: Tendril<UTF8, NonAtomic>
) -> Rc<Node>
&mut self,
target: Tendril<UTF8, NonAtomic>,
data: Tendril<UTF8, NonAtomic>
) -> Rc<Node>
fn append(&mut self, parent: &Rc<Node>, child: NodeOrText<Rc<Node>>)
fn append_before_sibling(
&mut self,
sibling: &Rc<Node>,
child: NodeOrText<Rc<Node>>
)
&mut self,
sibling: &Rc<Node>,
child: NodeOrText<Rc<Node>>
)
fn append_based_on_parent_node(
&mut self,
element: &<RcDom as TreeSink>::Handle,
prev_element: &<RcDom as TreeSink>::Handle,
child: NodeOrText<<RcDom as TreeSink>::Handle>
)
&mut self,
element: &<RcDom as TreeSink>::Handle,
prev_element: &<RcDom as TreeSink>::Handle,
child: NodeOrText<<RcDom as TreeSink>::Handle>
)
fn append_doctype_to_document(
&mut self,
name: Tendril<UTF8, NonAtomic>,
public_id: Tendril<UTF8, NonAtomic>,
system_id: Tendril<UTF8, NonAtomic>
)
&mut self,
name: Tendril<UTF8, NonAtomic>,
public_id: Tendril<UTF8, NonAtomic>,
system_id: Tendril<UTF8, NonAtomic>
)
fn add_attrs_if_missing(&mut self, target: &Rc<Node>, attrs: Vec<Attribute>)
fn remove_from_parent(&mut self, target: &Rc<Node>)
fn reparent_children(&mut self, node: &Rc<Node>, new_parent: &Rc<Node>)
fn is_mathml_annotation_xml_integration_point(&self, target: &Rc<Node>) -> bool
impl Default for RcDom
impl Selectable for RcDom
[src]
fn find_all_matching_child_nodes_depth_first_including_this_one<MatchUser: FnMut(&Rc<Node>) -> bool>(
&self,
selector: &OurSelector,
match_user: &mut MatchUser
) -> bool
[src]
&self,
selector: &OurSelector,
match_user: &mut MatchUser
) -> bool
Recursively find element nodes that match this selector. Return true from MatchUser to abort early. The result of this function is true if MatchUser aborted early, or false otherwise. Read more
fn matches(&self, selector: &OurSelector) -> bool
[src]
Returns whether this element matches this selector. For the RcDom and &'a [RcDom], is currently always false. Read more
impl Minify for RcDom
[src]
fn debug_fmt<W: Write>(&self, f: &mut W) -> Result
[src]
Identical to impl Debug's fmt() method, except we can't impl Debug for a trait and struct we don't own in this crate.
fn minify_to_file_path<P: AsRef<Path>>(
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool,
html_file_path: P
) -> Result<(), HtmlError>
[src]
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool,
html_file_path: P
) -> Result<(), HtmlError>
Minifies and serializes an instance of an HTML DOM to file. If creating AMP pages, set html_head_and_body_tags_are_optional
to false. Wraps use of UltraMinifyingHtmlSerializer
. If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly. Read more
fn minify_to_bytes(
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool
) -> Vec<u8>
[src]
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool
) -> Vec<u8>
Minifies and serializes an instance of an HTML DOM to a vector of bytes. If creating AMP pages, set html_head_and_body_tags_are_optional
to false. For maximum efficiency at the cost of slight inaccuracy, set collapse_whitespace
to true. (pre, code, samp and kbd are unaffected in any event). Wraps use of UltraMinifyingHtmlSerializer
. If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly. Read more
fn minify_to_writer<W: Write>(
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool,
writer: W
) -> Result<()>
[src]
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool,
writer: W
) -> Result<()>
Minifies and serializes an instance of an HTML DOM to a writer. If creating AMP pages, set html_head_and_body_tags_are_optional
to false. For maximum efficiency at the cost of slight inaccuracy, set collapse_whitespace
to true. (pre, code, samp and kbd are unaffected in any event). Wraps use of UltraMinifyingHtmlSerializer
. If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly. Read more
fn debug_string(&self) -> String
[src]
A debug string representing this node and any children.
fn minify_to_string(
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool
) -> String
[src]
&self,
html_head_and_body_tags_are_optional: bool,
collapse_whitespace: bool
) -> String
Minifies and serializes an instance of an HTML DOM to String. If creating AMP pages, set html_head_and_body_tags_are_optional
to false. For maximum efficiency at the cost of slight inaccuracy, set collapse_whitespace
to true. (pre, code, samp and kbd are unaffected in any event). Wraps use of UltraMinifyingHtmlSerializer
. If you need to serialize multiple RcDom or Node objects to the same writer, consider using UltraMinifyingHtmlSerializer
directly. Read more
impl QualNameExt for RcDom
[src]
fn is_unprefixed_and_html_namespace_or_none(&self) -> bool
[src]
Is this name effectively local?
fn is_only_local(&self, local_name: &LocalName) -> bool
[src]
Is this qualified name this local-only name (no prefix, no namespace)
fn is_only_local_of(&self, local_names: &[LocalName]) -> bool
[src]
Is this qualified name on these local-only names (no prefix, no namespace)
fn can_have_children(&self) -> bool
[src]
Can this element have children?
fn text_content_should_be_escaped(&self) -> bool
[src]
Should an immediate child text node have <
, >
and &
characters escaped? In modern HTML 5, the only common nodes which don't need this are <script>
and <style>
. In this case, the immediate child text node's content should not contain, say, </script>
as this will cause a parse error. Read more
fn can_collapse_whitespace(&self) -> bool
[src]
Can this element's descendant text nodes have leading, trailing and interstitial whitespace collapsed?
impl RcDomExt for RcDom
[src]
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>
[src]
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>>(
html_document_file_path: P
) -> Result<Self, HtmlError>
[src]
html_document_file_path: P
) -> Result<Self, HtmlError>
Creates an instance of an HTML DOM from a file path
fn verify(&self, context: &Path) -> Result<(), HtmlError>
[src]
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>
[src]
&self,
context: &Path
) -> Result<(), HtmlError>
Remove all comments and processing instructions and make the DOCTYPE a simple 'html' (for HTML 5).