Struct nipper::Document [−][src]
Document represents an HTML document to be manipulated.
Fields
errors: Vec<Cow<'static, str>>
Errors that occurred during parsing.
quirks_mode: QuirksMode
The document’s quirks mode.
Implementations
impl Document
[src]
impl Document
[src]
pub fn html(&self) -> StrTendril
[src]
Gets the HTML contents of the document. It includes the text and comment nodes.
pub fn text(&self) -> StrTendril
[src]
Gets the text content of the document.
impl Document
[src]
pub fn select(&self, sel: &str) -> Selection<'_>
[src]
Gets the descendants of the root document node in the current, filter by a selector. It returns a new selection object containing these matched elements.
Panics
Panics if failed to parse the given CSS selector.
pub fn nip(&self, sel: &str) -> Selection<'_>
[src]
Alias for select
, it gets the descendants of the root document node in the current, filter by a selector.
It returns a new selection object containing these matched elements.
Panics
Panics if failed to parse the given CSS selector.
pub fn try_select(&self, sel: &str) -> Option<Selection<'_>>
[src]
Gets the descendants of the root document node in the current, filter by a selector. It returns a new selection object containing these matched elements.
pub fn select_matcher<'a, 'b>(&'a self, matcher: &'b Matcher) -> Selection<'a>
[src]
Gets the descendants of the root document node in the current, filter by a matcher. It returns a new selection object containing these matched elements.
Trait Implementations
impl Default for Document
[src]
impl From<&'_ String> for Document
[src]
impl From<&'_ str> for Document
[src]
impl From<Tendril<UTF8, NonAtomic>> for Document
[src]
fn from(html: StrTendril) -> Document
[src]
impl TreeSink for Document
[src]
type Output = Self
The overall result of parsing. Read more
fn finish(self) -> Self
[src]
type Handle = NodeId
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
fn parse_error(&mut self, msg: Cow<'static, str>)
[src]
fn get_document(&mut self) -> NodeId
[src]
fn get_template_contents(&mut self, target: &NodeId) -> NodeId
[src]
fn set_quirks_mode(&mut self, mode: QuirksMode)
[src]
fn same_node(&self, x: &NodeId, y: &NodeId) -> bool
[src]
fn elem_name(&self, target: &NodeId) -> ExpandedName<'_>
[src]
fn create_element(
&mut self,
name: QualName,
attrs: Vec<Attribute>,
flags: ElementFlags
) -> NodeId
[src]
&mut self,
name: QualName,
attrs: Vec<Attribute>,
flags: ElementFlags
) -> NodeId
fn create_comment(&mut self, text: StrTendril) -> NodeId
[src]
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> NodeId
[src]
fn append(&mut self, parent: &NodeId, child: NodeOrText<NodeId>)
[src]
fn append_before_sibling(&mut self, sibling: &NodeId, child: NodeOrText<NodeId>)
[src]
fn append_based_on_parent_node(
&mut self,
element: &NodeId,
prev_element: &NodeId,
child: NodeOrText<NodeId>
)
[src]
&mut self,
element: &NodeId,
prev_element: &NodeId,
child: NodeOrText<NodeId>
)
fn append_doctype_to_document(
&mut self,
name: StrTendril,
public_id: StrTendril,
system_id: StrTendril
)
[src]
&mut self,
name: StrTendril,
public_id: StrTendril,
system_id: StrTendril
)
fn add_attrs_if_missing(&mut self, target: &NodeId, attrs: Vec<Attribute>)
[src]
fn remove_from_parent(&mut self, target: &NodeId)
[src]
fn reparent_children(&mut self, node: &NodeId, new_parent: &NodeId)
[src]
pub fn mark_script_already_started(&mut self, _node: &Self::Handle)
[src]
pub fn pop(&mut self, _node: &Self::Handle)
[src]
pub fn associate_with_form(
&mut self,
_target: &Self::Handle,
_form: &Self::Handle,
_nodes: (&Self::Handle, Option<&Self::Handle>)
)
[src]
&mut self,
_target: &Self::Handle,
_form: &Self::Handle,
_nodes: (&Self::Handle, Option<&Self::Handle>)
)
pub fn is_mathml_annotation_xml_integration_point(
&self,
_handle: &Self::Handle
) -> bool
[src]
&self,
_handle: &Self::Handle
) -> bool
pub fn set_current_line(&mut self, _line_number: u64)
[src]
pub fn complete_script(&mut self, _node: &Self::Handle) -> NextParserState
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,