Struct clang::TranslationUnit [] [src]

pub struct TranslationUnit<'i> { /* fields omitted */ }

A preprocessed and parsed source file.

Methods

impl<'i> TranslationUnit<'i>
[src]

Constructs a new TranslationUnit from an AST file.

Failures

  • an unknown error occurs

Returns the diagnostics for this translation unit.

Returns the entity for this translation unit.

Returns the file at the supplied path in this translation unit, if any.

Returns the memory usage of this translation unit.

Returns the AST entities which correspond to the supplied tokens, if any.

Returns a completer which runs code completion.

Saves this translation unit to an AST file.

Failures

  • errors in the translation unit prevent saving
  • an unknown error occurs

Consumes this translation unit and reparses the source file it was created from with the same compiler arguments that were used originally.

Failures

  • an error occurs while deserializing an AST file
  • libclang crashes
  • an unknown error occurs

Trait Implementations

impl<'i> Drop for TranslationUnit<'i>
[src]

A method called when the value goes out of scope. Read more

impl<'i> Debug for TranslationUnit<'i>
[src]

Formats the value using the given formatter.