[−][src]Struct lol_html::DocumentContentHandlers
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]
self,
handler: impl FnMut(&mut Doctype) -> Result<(), Box<dyn Error>> + 'h
) -> Self
Sets a handler for the document type declaration.
pub fn comments(
self,
handler: impl FnMut(&mut Comment) -> Result<(), Box<dyn Error>> + 'h
) -> Self
[src]
self,
handler: impl FnMut(&mut Comment) -> Result<(), Box<dyn Error>> + 'h
) -> Self
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]
self,
handler: impl FnMut(&mut TextChunk) -> Result<(), Box<dyn Error>> + 'h
) -> Self
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]
self,
handler: impl FnMut(&mut DocumentEnd) -> Result<(), Box<dyn Error>> + 'h
) -> Self
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]
fn default() -> DocumentContentHandlers<'h>
[src]
Auto Trait Implementations
impl<'h> !RefUnwindSafe for DocumentContentHandlers<'h>
impl<'h> !Send for DocumentContentHandlers<'h>
impl<'h> !Sync for DocumentContentHandlers<'h>
impl<'h> Unpin for DocumentContentHandlers<'h>
impl<'h> !UnwindSafe for DocumentContentHandlers<'h>
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,
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.
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>,