Struct lol_html::ElementContentHandlers
source · pub struct ElementContentHandlers<'h> {
pub element: Option<ElementHandler<'h>>,
pub comments: Option<CommentHandler<'h>>,
pub text: Option<TextHandler<'h>>,
}
Expand description
Specifies element content handlers associated with a selector.
Fields§
§element: Option<ElementHandler<'h>>
Element handler. See ElementHandler.
comments: Option<CommentHandler<'h>>
Comment handler. See CommentHandler.
text: Option<TextHandler<'h>>
Text handler. See TextHandler.
Implementations§
source§impl<'h> ElementContentHandlers<'h>
impl<'h> ElementContentHandlers<'h>
sourcepub fn element(
self,
handler: impl FnMut(&mut Element<'_, '_>) -> HandlerResult + 'h
) -> Self
pub fn element( self, handler: impl FnMut(&mut Element<'_, '_>) -> HandlerResult + 'h ) -> Self
Sets a handler for elements matched by a selector.
sourcepub fn comments(
self,
handler: impl FnMut(&mut Comment<'_>) -> HandlerResult + 'h
) -> Self
pub fn comments( self, handler: impl FnMut(&mut Comment<'_>) -> HandlerResult + 'h ) -> Self
Sets a handler for HTML comments in the inner content of elements matched by a selector.
sourcepub fn text(
self,
handler: impl FnMut(&mut TextChunk<'_>) -> HandlerResult + 'h
) -> Self
pub fn text( self, handler: impl FnMut(&mut TextChunk<'_>) -> HandlerResult + 'h ) -> Self
Sets a handler for text chunks in the inner content of elements matched by a selector.
Trait Implementations§
source§impl<'h> Default for ElementContentHandlers<'h>
impl<'h> Default for ElementContentHandlers<'h>
source§fn default() -> ElementContentHandlers<'h>
fn default() -> ElementContentHandlers<'h>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'h> !RefUnwindSafe for ElementContentHandlers<'h>
impl<'h> !Send for ElementContentHandlers<'h>
impl<'h> !Sync for ElementContentHandlers<'h>
impl<'h> Unpin for ElementContentHandlers<'h>
impl<'h> !UnwindSafe for ElementContentHandlers<'h>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more