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

An AST entity.

Implementations

Evaluates this AST entity, if possible.

Returns the categorization of this AST entity.

Returns the display name of this AST entity, if any.

The display name of an entity contains additional information that helps identify the entity.

Returns the pretty printer for this declaration.

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

Returns the source range of this AST entity, if any.

Returns the accessibility of this declaration or base class specifier, if applicable.

Returns the arguments of this function or method, if applicable.

Returns the availability of this AST entity.

Returns the width of this bit field, if applicable.

Returns the canonical entity for this AST entity.

In the C family of languages, some types of entities can be declared multiple times. When there are multiple declarations of the same entity, only one will be considered canonical.

Returns the comment associated with this AST entity, if any.

Returns the parsed comment associated with this declaration, if applicable.

Returns the brief of the comment associated with this AST entity, if any.

Returns the source range of the comment associated with this AST entity, if any.

Returns a completion string for this declaration or macro definition, if applicable.

Returns the child of this AST entity with the supplied index.

Returns the children of this AST entity.

Returns the AST entity that describes the definition of this AST entity, if any.

Returns the value of this enum constant declaration, if applicable.

Returns the underlying type of this enum declaration, if applicable.

Returns the exception specification of this AST entity, if applicable.

Returns the external_source_symbol attribute attached to this AST entity, if any.

Returns the file included by this inclusion directive, if applicable.

Returns the language used by this declaration, if applicable.

Returns the lexical parent of this AST entity, if any.

Returns the linkage of this AST entity, if any.

Returns the mangled name of this AST entity, if any.

Returns the mangled names of this C++ constructor or destructor, if applicable.

Returns the mangled names of this Objective-C class interface or implementation, if applicable.

Returns the module imported by this module import declaration, if applicable.

Returns the name of this AST entity, if any.

Returns the source ranges of the name of this AST entity.

Returns which attributes were applied to this Objective-C property, if applicable.

Returns the name of the method implementing the getter for this Objective-C property, if applicable

Returns the element type for this Objective-C iboutletcollection attribute, if applicable.

Returns the type of the receiver of this Objective-C message, if applicable.

Returns the selector index for this Objective-C selector identifier, if applicable.

Returns the name of the method implementing the setter for this Objective-C property, if applicable

Returns the type encoding for this Objective-C declaration, if applicable.

Returns which qualifiers were applied to this Objective-C method return or parameter type, if applicable.

Returns the the offset of this field, if applicable.

Returns the overloaded declarations referenced by this overloaded declaration reference, if applicable.

Returns the methods that were overridden by this method, if applicable.

Returns the availability of this declaration on the platforms where it is known, if applicable.

Returns the AST entity referred to by this AST entity, if any.

Returns the semantic parent of this AST entity, if any.

Returns the storage class of this declaration, if applicable.

Returns the template declaration this template specialization was instantiated from, if applicable.

Returns the template arguments for this template function specialization, if applicable.

Returns the categorization of the template specialization that would result from instantiating this template declaration, if applicable.

Returns the thread-local storage (TLS) kind of this declaration, if applicable.

Returns the translation unit which contains this AST entity.

Returns the type of this AST entity, if any.

Returns the underlying type of this typedef declaration, if applicable.

Returns the USR for this AST entity, if any.

Returns the linker visibility for this AST entity, if any.

Returns the result type of this AST entity, if applicable.

Returns whether this AST entity has any attached attributes.

Returns whether this AST entity is an abstract C++ record.

Returns whether this AST entity is anonymous.

Prior to libclang 9.0, this only returned true if the entity was an anonymous record declaration. As of 9.0, it also returns true for anonymous namespaces. The old behavior is available as is_anonymous_record_decl() for libclang 9.0 and up.

Returns whether this AST entity is an anonymous record declaration.

Returns whether this AST entity is an inline namespace.

Returns whether this AST entity is a bit field.

Returns whether this AST entity is a builtin macro.

Returns whether this AST entity is a const method.

Returns whether this AST entity is a C++ converting constructor.

Returns whether this AST entity is a C++ copy constructor.

Returns whether this AST entity is a C++ default constructor.

Returns whether this AST entity is a C++ defaulted constructor or method.

Returns whether this AST entity is a declaration and also the definition of that declaration.

Returns whether this AST entity is a dynamic call.

A dynamic call is either a call to a C++ virtual method or an Objective-C message where the receiver is an object instance, not super or a specific class.

Returns whether this AST entity is a function-like macro.

Returns whether this AST entity is an inline function.

Returns whether this AST entity is an invalid declaration.

Returns whether this AST entity is a C++ default constructor.

Returns whether this AST entity is a mutable field in a C++ struct or class.

Returns whether this AST entity is an Objective-C method or property declaration with the @optional attribute applied to it.

Returns whether this AST entity is a pure virtual method.

Returns whether this AST entity is a scoped enum.

Returns whether this AST entity is a static method.

Returns whether this AST entity is a variadic function or method.

Returns whether this AST entity is a virtual base class specifier.

Returns whether this AST entity is a virtual method.

Visits the children of this AST entity recursively and returns whether visitation was ended by the callback returning EntityVisitResult::Break.

The first argument of the callback is the AST entity being visited and the second argument is the parent of that AST entity. The return value of the callback determines how visitation will proceed.

Returns whether this AST entity is categorized as an attribute.

Returns whether this AST entity is categorized as a declaration.

Returns whether this AST entity is categorized as an expression.

Returns whether this AST entity is categorized as a preprocessing entity.

Returns whether this AST entity is categorized as a reference.

Returns whether this AST entity is categorized as a statement.

Returns whether the categorization of this AST entity is unexposed.

Returns whether this AST entity is in a main file.

Returns whether this AST entity is in a system header.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.