Struct clang::source::SourceLocation
source · [−]pub struct SourceLocation<'tu> { /* private fields */ }
Expand description
A location in a source file.
Implementations
sourceimpl<'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
sourceimpl<'tu> Clone for SourceLocation<'tu>
impl<'tu> Clone for SourceLocation<'tu>
sourcefn clone(&self) -> SourceLocation<'tu>
fn clone(&self) -> SourceLocation<'tu>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'tu> Debug for SourceLocation<'tu>
impl<'tu> Debug for SourceLocation<'tu>
sourceimpl<'tu> Hash for SourceLocation<'tu>
impl<'tu> Hash for SourceLocation<'tu>
sourceimpl<'tu> PartialEq<SourceLocation<'tu>> for SourceLocation<'tu>
impl<'tu> PartialEq<SourceLocation<'tu>> for SourceLocation<'tu>
impl<'tu> Copy for SourceLocation<'tu>
impl<'tu> Eq for SourceLocation<'tu>
Auto Trait Implementations
impl<'tu> RefUnwindSafe for SourceLocation<'tu>
impl<'tu> !Send for SourceLocation<'tu>
impl<'tu> !Sync for SourceLocation<'tu>
impl<'tu> Unpin for SourceLocation<'tu>
impl<'tu> UnwindSafe for SourceLocation<'tu>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more