Choose an API pattern for html5gum
mainDepending on your performance and convenience requirements, html5gum provides four primary ways to consume tokens:
- Iterator API: Iterate over tokens using
Tokenizer::new(html). Best for general purpose use and ease of implementation. - Custom Emitter API: Implement your own
Emittertrait for maximum performance. This is the fastest way to process or transform HTML. - Callback-based API: A middleground between convenience and performance using callbacks.
- Tree-builder API: By enabling the
tree-builderfeature, you can integratehtml5gumwithhtml5everandscraperto perform full DOM-based parsing.