pub struct SourceLocation<'tu> { /* private fields */ }
Expand description
A location in a source file.
Implementations§
Source§impl<'tu> SourceLocation<'tu>
impl<'tu> SourceLocation<'tu>
Sourcepub fn get_expansion_location(&self) -> Location<'tu>
pub fn get_expansion_location(&self) -> Location<'tu>
Returns the file, line, column and character offset of this source location.
If this source location is inside a macro expansion, the location of the macro expansion is returned instead.
Sourcepub fn get_file_location(&self) -> Location<'tu>
pub fn get_file_location(&self) -> Location<'tu>
Returns the file, line, column and character offset of this source location.
If this source location is inside a macro expansion, the location of the macro expansion is returned instead unless this source location is inside a macro argument. In that case, the location of the macro argument is returned.
Sourcepub fn get_presumed_location(&self) -> (String, u32, u32)
pub fn get_presumed_location(&self) -> (String, u32, u32)
Returns the file path, line, and column of this source location taking line directives into account.
Sourcepub fn get_spelling_location(&self) -> Location<'tu>
pub fn get_spelling_location(&self) -> Location<'tu>
Returns the file, line, column and character offset of this source location.
Sourcepub fn get_entity(&self) -> Option<Entity<'tu>>
pub fn get_entity(&self) -> Option<Entity<'tu>>
Returns the AST entity at this source location, if any.
Sourcepub fn is_in_main_file(&self) -> bool
pub fn is_in_main_file(&self) -> bool
Returns whether this source location is in the main file of its translation unit.
Sourcepub fn is_in_system_header(&self) -> bool
pub fn is_in_system_header(&self) -> bool
Returns whether this source location is in a system header.
Trait Implementations§
Source§impl<'tu> Clone for SourceLocation<'tu>
impl<'tu> Clone for SourceLocation<'tu>
Source§fn clone(&self) -> SourceLocation<'tu>
fn clone(&self) -> SourceLocation<'tu>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more