[][src]Struct clang::source::SourceLocation

pub struct SourceLocation<'tu> { /* fields omitted */ }

A location in a source file.

Implementations

impl<'tu> SourceLocation<'tu>[src]

pub fn get_expansion_location(&self) -> Location<'tu>[src]

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.

pub fn get_file_location(&self) -> Location<'tu>[src]

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.

pub fn get_presumed_location(&self) -> (String, u32, u32)[src]

Returns the file path, line, and column of this source location taking line directives into account.

pub fn get_spelling_location(&self) -> Location<'tu>[src]

Returns the file, line, column and character offset of this source location.

pub fn get_entity(&self) -> Option<Entity<'tu>>[src]

Returns the AST entity at this source location, if any.

pub fn is_in_main_file(&self) -> bool[src]

Returns whether this source location is in the main file of its translation unit.

pub fn is_in_system_header(&self) -> bool[src]

Returns whether this source location is in a system header.

Trait Implementations

impl<'tu> Clone for SourceLocation<'tu>[src]

impl<'tu> Copy for SourceLocation<'tu>[src]

impl<'tu> Debug for SourceLocation<'tu>[src]

impl<'tu> Eq for SourceLocation<'tu>[src]

impl<'tu> Hash for SourceLocation<'tu>[src]

impl<'tu> PartialEq<SourceLocation<'tu>> for SourceLocation<'tu>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.