[][src]Module codespan_reporting::files

Source file support for diagnostic reporting.

The main trait defined in this module is the Files trait, which provides provides the minimum amount of functionality required for printing Diagnostics with the term::emit function.

Simple implementations of this trait are implemented:

These data structures provide a pretty minimal API, however, so end-users are encouraged to create their own implementations for their own specific use-cases, such as an implementation that accesses the file system directly (and caches the line start locations), or an implementation using an incremental compilation library like salsa.

Structs

Location

A user-facing location in a source file.

SimpleFile

A file database that contains a single source file.

SimpleFiles

A file database that can store multiple source files.

Enums

Error

An enum representing an error that happened while looking up a file or a piece of content in that file.

Traits

Files

A minimal interface for accessing source files when rendering diagnostics.

Functions

column_index

The column index at the given byte index in the source file. This is the number of characters to the given byte index.

line_starts

Return the starting byte index of each line in the source string.