Struct html2md::RcDom [−][src]
pub struct RcDom { pub document: Rc<Node>, pub errors: Vec<Cow<'static, str>, Global>, pub quirks_mode: QuirksMode, }
Expand description
The DOM itself; the result of parsing.
Fields
document: Rc<Node>
Expand description
The Document
itself.
errors: Vec<Cow<'static, str>, Global>
Expand description
Errors that occurred during parsing.
quirks_mode: QuirksMode
Expand description
The document’s quirks mode.
Trait Implementations
impl TreeSink for RcDom
[src]
impl TreeSink for RcDom
[src]pub fn finish(self) -> RcDom
[src]
pub fn finish(self) -> RcDom
[src]Consume this sink and return the overall result of parsing. Read more
type Handle = Rc<Node>
type Handle = Rc<Node>
Handle
is a reference to a DOM node. The tree builder requires
that a Handle
implements Clone
to get another reference to
the same node. Read more
pub fn parse_error(&mut self, msg: Cow<'static, str>)
[src]
pub fn parse_error(&mut self, msg: Cow<'static, str>)
[src]Signal a parse error.
pub fn get_document(&mut self) -> Rc<Node>
[src]
pub fn get_document(&mut self) -> Rc<Node>
[src]Get a handle to the Document
node.
pub fn get_template_contents(&mut self, target: &Rc<Node>) -> Rc<Node>
[src]
pub fn get_template_contents(&mut self, target: &Rc<Node>) -> Rc<Node>
[src]Get a handle to a template’s template contents. The tree builder promises this will never be called with something else than a template element. Read more
pub fn set_quirks_mode(&mut self, mode: QuirksMode)
[src]
pub fn set_quirks_mode(&mut self, mode: QuirksMode)
[src]Set the document’s quirks mode.
pub fn same_node(&self, x: &Rc<Node>, y: &Rc<Node>) -> bool
[src]
pub fn same_node(&self, x: &Rc<Node>, y: &Rc<Node>) -> bool
[src]Do two handles refer to the same node?
pub fn elem_name(&self, target: &'a Rc<Node>) -> ExpandedName<'a>
[src]
pub fn elem_name(&self, target: &'a Rc<Node>) -> ExpandedName<'a>
[src]What is the name of this element? Read more
pub fn create_element(
&mut self,
name: QualName,
attrs: Vec<Attribute, Global>,
flags: ElementFlags
) -> Rc<Node>
[src]
pub fn create_element(
&mut self,
name: QualName,
attrs: Vec<Attribute, Global>,
flags: ElementFlags
) -> Rc<Node>
[src]Create an element. Read more
pub fn create_comment(&mut self, text: Tendril<UTF8, NonAtomic>) -> Rc<Node>
[src]
pub fn create_comment(&mut self, text: Tendril<UTF8, NonAtomic>) -> Rc<Node>
[src]Create a comment node.
pub fn create_pi(
&mut self,
target: Tendril<UTF8, NonAtomic>,
data: Tendril<UTF8, NonAtomic>
) -> Rc<Node>
[src]
pub fn create_pi(
&mut self,
target: Tendril<UTF8, NonAtomic>,
data: Tendril<UTF8, NonAtomic>
) -> Rc<Node>
[src]Create a Processing Instruction node.
pub fn append(&mut self, parent: &Rc<Node>, child: NodeOrText<Rc<Node>>)
[src]
pub fn append(&mut self, parent: &Rc<Node>, child: NodeOrText<Rc<Node>>)
[src]Append a node as the last child of the given node. If this would produce adjacent sibling text nodes, it should concatenate the text instead. Read more
pub fn append_before_sibling(
&mut self,
sibling: &Rc<Node>,
child: NodeOrText<Rc<Node>>
)
[src]
pub fn append_before_sibling(
&mut self,
sibling: &Rc<Node>,
child: NodeOrText<Rc<Node>>
)
[src]Append a node as the sibling immediately before the given node. Read more
pub 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>
)
[src]
pub 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>
)
[src]When the insertion point is decided by the existence of a parent node of the element, we consider both possibilities and send the element which will be used if a parent node exists, along with the element to be used if there isn’t one. Read more
pub fn append_doctype_to_document(
&mut self,
name: Tendril<UTF8, NonAtomic>,
public_id: Tendril<UTF8, NonAtomic>,
system_id: Tendril<UTF8, NonAtomic>
)
[src]
pub fn append_doctype_to_document(
&mut self,
name: Tendril<UTF8, NonAtomic>,
public_id: Tendril<UTF8, NonAtomic>,
system_id: Tendril<UTF8, NonAtomic>
)
[src]Append a DOCTYPE
element to the Document
node.
pub fn add_attrs_if_missing(
&mut self,
target: &Rc<Node>,
attrs: Vec<Attribute, Global>
)
[src]
pub fn add_attrs_if_missing(
&mut self,
target: &Rc<Node>,
attrs: Vec<Attribute, Global>
)
[src]Add each attribute to the given element, if no attribute with that name already exists. The tree builder promises this will never be called with something else than an element. Read more
pub fn remove_from_parent(&mut self, target: &Rc<Node>)
[src]
pub fn remove_from_parent(&mut self, target: &Rc<Node>)
[src]Detach the given node from its parent.
pub fn reparent_children(&mut self, node: &Rc<Node>, new_parent: &Rc<Node>)
[src]
pub fn reparent_children(&mut self, node: &Rc<Node>, new_parent: &Rc<Node>)
[src]Remove all the children from node and append them to new_parent.
pub fn is_mathml_annotation_xml_integration_point(
&self,
target: &Rc<Node>
) -> bool
[src]
pub fn is_mathml_annotation_xml_integration_point(
&self,
target: &Rc<Node>
) -> bool
[src]Returns true if the adjusted current node is an HTML integration point and the token is a start tag. Read more
fn mark_script_already_started(&mut self, _node: &Self::Handle)
fn mark_script_already_started(&mut self, _node: &Self::Handle)
Mark a HTML <script>
as “already started”.
fn pop(&mut self, _node: &Self::Handle)
fn pop(&mut self, _node: &Self::Handle)
Indicate that a node was popped off the stack of open elements.
fn associate_with_form(
&mut self,
_target: &Self::Handle,
_form: &Self::Handle,
_nodes: (&Self::Handle, Option<&Self::Handle>)
)
fn associate_with_form(
&mut self,
_target: &Self::Handle,
_form: &Self::Handle,
_nodes: (&Self::Handle, Option<&Self::Handle>)
)
Associate the given form-associatable element with the form element
fn set_current_line(&mut self, _line_number: u64)
fn set_current_line(&mut self, _line_number: u64)
Called whenever the line number changes.
fn complete_script(&mut self, _node: &Self::Handle) -> NextParserState
fn complete_script(&mut self, _node: &Self::Handle) -> NextParserState
Indicate that a script
element is complete.