Struct codemap::File [] [src]

pub struct File {
    pub span: Span,
    // some fields omitted
}

A CodeMap's record of a source file.

Fields

The span representing the entire file.

Methods

impl File
[src]

[src]

Gets the name of the file

[src]

Gets the line number of a Pos.

The lines are 0-indexed (first line is numbered 0)

Panics

  • If pos is not within this file's span

[src]

Gets the line and column of a Pos.

Panics

  • If pos is not with this file's span
  • If pos points to a byte in the middle of a UTF-8 character

[src]

Gets the full source text of the file

[src]

Gets the source text of a Span.

Panics

  • If span is not entirely within this file.

[src]

Gets the span representing a line by line number.

The line number is 0-indexed (first line is numbered 0). The returned span includes the line terminator.

Panics

  • If the line number is out of range

[src]

Gets the source text of a line.

The string returned does not include the terminating \r or \n characters.

Panics

  • If the line number is out of range

[src]

Gets the number of lines in the file

Trait Implementations

impl Debug for File
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for File
[src]

[src]

Compares by identity

1.0.0
[src]

This method tests for !=.

impl Eq for File
[src]

impl Hash for File
[src]

[src]

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

1.3.0
[src]

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