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 offsetsusize
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
- A zero-sized no-op implementation of
Offset
(for when you don’t want to track offsets). - Wraps a
Reader
so that it implementsPosition<usize>
.
Traits
- A byte offset in the source.
- A trait to be implemented by readers that track their own position.