Source structv0.1.0

Source
The location of the expression that reads it.
pub struct Source {
    pub line: uint;
    pub column: uint;
    pub file: char8[..];
    pub fileName: char8[..];
    pub filePath: char8[..];
    pub function: char8[..];
    pub module: char8[..];
}

Every field is fixed while compiling, from the read's own position. A field read produces no runtime code beyond the constant it folds to; the text fields borrow the compiler's own storage, which outlives the program.

Fields

NameTypeDescription
lineuintThe one-based line of the reading expression.
columnuintThe one-based column of the reading expression.
filechar8[..]The source file as the build named it, which is the spelling a diagnostic uses.
fileNamechar8[..]The file's last path component, with its extension.
filePathchar8[..]The file's path, relative to the package root where the file belongs to one.
functionchar8[..]The enclosing function, qualified with its type for a method.
modulechar8[..]The enclosing module path, relative to the package root.

#source

pub const #source: Source;

The reading expression's own location, as a compile-time value.

Source