Struct sourcefile::SourceFile[][src]

pub struct SourceFile {
    pub contents: String,
    // some fields omitted
}

A concatenated string of files, with sourcemap information.

Fields

The full contents of all the files

Methods

impl SourceFile
[src]

Concatenate a file to the end of contents, and record info needed to resolve spans.

If the last line doesn't end with a newline character, it will still be a 'line' for the purposes of this calcuation.

Consumes self because the structure would be inconsistent after an error.

Get the file, line, and col position of a byte offset.

Panics

This function will panic if offset is not on a character boundary.

Get the file, line, and col position of each end of a span

Trait Implementations

impl Default for SourceFile
[src]

Returns the "default value" for a type. Read more

impl Debug for SourceFile
[src]

Formats the value using the given formatter. Read more

impl Clone for SourceFile
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for SourceFile
[src]

impl PartialEq for SourceFile
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for SourceFile
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for SourceFile
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for SourceFile
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for SourceFile

impl Sync for SourceFile