Expand description
Domain-specific source coordinates.
Byte offsets, line numbers, and column positions use distinct newtypes so
they cannot be passed to the wrong API by accident. Conversions to raw
usize are explicit via inherent get methods or usize::from.
Structsยง
- Byte
Column - 1-based byte column offset from the start of a line.
- Byte
Line Col - 1-based line and byte-column position returned by
super::LineIndex::line_col. - Byte
Offset - 0-based UTF-8 byte offset into source text.
- Char
Column - 1-based Unicode scalar column offset from the start of a line.
- Char
Line Col - 1-based line and character-column position returned by
super::LineIndex::char_line_col. - Invalid
OneBased Coordinate - Error returned when constructing a 1-based coordinate from zero.
- Line
Number - 1-based line number in a source file.
- Utf16
Offset - 0-based UTF-16 code-unit offset into source text.
- Utf16
Range - 0-based half-open range in UTF-16 code units.