Skip to main content

Module coordinate

Module coordinate 

Source
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ยง

ByteColumn
1-based byte column offset from the start of a line.
ByteLineCol
1-based line and byte-column position returned by super::LineIndex::line_col.
ByteOffset
0-based UTF-8 byte offset into source text.
CharColumn
1-based Unicode scalar column offset from the start of a line.
CharLineCol
1-based line and character-column position returned by super::LineIndex::char_line_col.
InvalidOneBasedCoordinate
Error returned when constructing a 1-based coordinate from zero.
LineNumber
1-based line number in a source file.
Utf16Offset
0-based UTF-16 code-unit offset into source text.
Utf16Range
0-based half-open range in UTF-16 code units.