Module html5tokenizer::offset

source ·
Expand description

Source code offsets.

The Emitter is generic over an Offset. This library comes with two Offset implementations:

  • NoopOffset for when you don’t want to track source offsets
  • usize for when you do want to track source offsets

To use the latter your reader however has to implement Position<usize>. You can easily use any existing reader by wrapping it in the PosTrackingReader struct which implements the Position<usize> trait and takes care of tracking the current position.

Structs

Traits

  • A byte offset in the source.
  • A trait to be implemented by readers that track their own position.