[][src]Struct lol_html::DocumentContentHandlers

pub struct DocumentContentHandlers<'h> { /* fields omitted */ }

Specifies document-level content handlers.

Some content can't be captured by CSS selectors as it lays outside of content of any of the HTML elements. Document-level handlers allow capture such a content:

<!doctype html>
<!--
    I can't be captured with a selector, but I can be
    captured with a document-level comment handler
-->
<html>
<!-- I can be captured with a selector -->
</html>

Methods

impl<'h> DocumentContentHandlers<'h>[src]

pub fn doctype(
    self,
    handler: impl FnMut(&mut Doctype) -> Result<(), Box<dyn Error>> + 'h
) -> Self
[src]

Sets a handler for the document type declaration.

pub fn comments(
    self,
    handler: impl FnMut(&mut Comment) -> Result<(), Box<dyn Error>> + 'h
) -> Self
[src]

Sets a handler for all HTML comments present in the input HTML markup.

pub fn text(
    self,
    handler: impl FnMut(&mut TextChunk) -> Result<(), Box<dyn Error>> + 'h
) -> Self
[src]

Sets a handler for all text chunks present in the input HTML markup.

pub fn end(
    self,
    handler: impl FnMut(&mut DocumentEnd) -> Result<(), Box<dyn Error>> + 'h
) -> Self
[src]

Sets a handler for the document end, which is called after the last chunk is processed.

Trait Implementations

impl<'h> Default for DocumentContentHandlers<'h>[src]

Auto Trait Implementations

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.