Expand description
Source locations: byte-offset Spans and their LineIndex translation
into human-readable line/column LinePositions.
Structsยง
- Line
Index - A precomputed map from byte offsets to line/column positions for one source
string. Build it once with
LineIndex::new, then query repeatedly. - Line
Position - A 1-based line and column, derived from a byte offset by
LineIndex. - Span
- A half-open byte range
start..endinto the original source string. These are absolute UTF-8 byte offsets from the start of the document (not line/column); useLineIndexto translate an offset into a line and column.