[][src]Struct nipper::Document

pub struct Document {
    pub errors: Vec<Cow<'static, str>>,
    pub quirks_mode: QuirksMode,
    // some fields omitted
}

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]

pub fn root(&self) -> NodeRef<NodeData>[src]

Return the underlying root document node.

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]

impl TreeSink for Document[src]

type Output = Self

The overall result of parsing. Read more

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

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.