-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
ElementContentHandlers
and DocumentContentHandlers
fields pu…
…blic. This is helpful if you want to patch already created handlers with extra functionality. For instance, if you want to measure the time a handler takes to run you can do something like: ``` fn measure_element_time_handler(handlers: ElementContentHandlers<'_>) -> = ElementContentHandlers<'_> { let element_handler = self.element.take().map(|handler| { |element| { // measure start time here. let result = handler(element); // measure end time here. result } }); ElementContentHandlers { element: element_handler, comments: self.comments.take(), text: self.text.take(), } } ```
- Loading branch information
Showing
3 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters