Crate codespan

Source
Expand description

Utilities for working with source code and printing nicely formatted diagnostic information like warnings and errors.

§Optional Features

Extra functionality is accessible by enabling feature flags. The features currently available are:

  • serialization - Adds Serialize and Deserialize implementations for use with serde

Structs§

ByteIndex
A byte position in a source file.
ByteOffset
A byte offset in a source file
ColumnIndex
A zero-indexed column offset into a source file
ColumnNumber
A 1-indexed column number. Useful for pretty printing source locations.
ColumnOffset
A column offset in a source file
FileId
A handle that points to a file in the database.
Files
A database of source files.
LineIndex
A zero-indexed line offset into a source file
LineNumber
A 1-indexed line number. Useful for pretty printing source locations.
LineOffset
A line offset in a source file
Location
A location in a source file.
Span

Traits§

Index
Index types
Offset
A relative offset between two indices

Type Aliases§

RawIndex
The raw, untyped index. We use a 32-bit integer here for space efficiency, assuming we won’t be working with sources larger than 4GB.
RawOffset
The raw, untyped offset.