Struct static_analyser::codemap::FileMap [] [src]

pub struct FileMap { /* fields omitted */ }

A mapping which keeps track of a file's contents and allows you to cheaply access substrings of the original content.

Methods

impl FileMap
[src]

Get the name of this FileMap.

Get the entire content of this file.

Lookup a span in this FileMap.

Panics

If the FileMap's items hashmap contains a span, but that span doesn't point to a valid substring this will panic. If you ever get into a situation like this then things are almost certainly FUBAR.

Get the range corresponding to this span.

impl FileMap
[src]

Ask the FileMap to give you the span corresponding to the half-open interval [start, end).

Panics

In debug mode, this will panic if either start or end are outside the source code or if they don't lie on a codepoint boundary.

It is assumed that the start and indices were originally obtained from the file's contents.

Merge two spans to get the span which includes both.

As usual, the constraints from insert_span() also apply here. If you try to enter two spans from different FileMaps, it'll panic.

impl FileMap
[src]

Register a set of tokenized inputs and turn them into a proper stream of tokens. Note that all the caveats from insert_span() also apply here.

Trait Implementations

impl Clone for FileMap
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for FileMap
[src]

Formats the value using the given formatter.