pub struct Location {
    pub file: Option<String>,
    pub line: usize,
    pub col: usize,
}
Expand description

A location within a document buffer or document file. This module uses Location to identify to refer to locations of JSON5 syntax errors, while parsing) and also to locations in this Rust source file, to improve unit testing output.

Fields

file: Option<String>

The name of the JSON5 document file being parsed and formatted (if provided).

line: usize

A line number within the JSON5 document. (The first line at the top of the document/file is line 1.)

col: usize

A character column number within the specified line. (The left-most character of the line is column 1).

Implementations

Create a new Location for the given source document location.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.