pub struct Parser<'tu> { /* private fields */ }
Expand description

Parses translation units.

Implementations

Sets whether certain code completion results will be cached when the translation unit is reparsed.

This option increases the time it takes to reparse the translation unit but improves code completion performance.

Sets whether a detailed preprocessing record will be constructed which tracks all macro definitions and instantiations.

Sets whether documentation comment briefs will be included in code completion results.

Sets whether the translation unit will be considered incomplete.

This option suppresses certain semantic analyses and is typically used when parsing headers with the intent of creating a precompiled header.

Sets whether function and method bodies will be skipped.

Sets whether processing will continue after a fatal error is encountered.

Sets whether incremental processing will be used.

Sets whether function bodies will only be skipped in the preamble.

Used in conjunction with skip_function_bodies.

Sets whether attributed types should be included.

Sets whether implicit attributes should be visited.

Indicates that non-errors (e.g. warnings) from included files should be ignored.

Sets whether the preprocessor will retain excluded conditional blocks.

Sets the compiler arguments to provide to libclang.

Any compiler argument that could be supplied to clang may be supplied to this function. However, the following arguments are ignored:

  • -c
  • -emit-ast
  • -fsyntax-only
  • -o and the following <output>

Sets the unsaved files to use.

Parses a translation unit.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.