pub struct TranslationUnit<'i> { /* private fields */ }
Expand description

A preprocessed and parsed source file.

Implementations

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 source ranges in this translation unit that were skipped by the preprocessor.

This will always return an empty Vec if the translation unit was not constructed with a detailed preprocessing record.

Returns information about the target for 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

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.