Struct clang::Type [] [src]

pub struct Type<'tu> {
    // some fields omitted
}

The type of an AST entity.

Methods

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

fn get_alignof(&self) -> Result<usizeAlignofError>

Returns the alignment of this type in bytes.

Failures

  • this type is a dependent type
  • this type is an incomplete type

fn get_argument_types(&self) -> Option<Vec<Type<'tu>>>

Returns the argument types for this function or method type, if applicable.

fn get_calling_convention(&self) -> Option<CallingConvention>

Returns the calling convention specified for this function type, if applicable.

fn get_canonical_type(&self) -> Type<'tu>

Returns the canonical type for this type.

The canonical type is the underlying type with all "sugar" removed (e.g., typedefs).

fn get_class_type(&self) -> Option<Type<'tu>>

Returns the class type for this member pointer type, if applicable.

fn get_declaration(&self) -> Option<Entity<'tu>>

Returns the AST entity that declared this type, if any.

fn get_display_name(&self) -> String

Returns the display name of this type.

fn get_element_type(&self) -> Option<Type<'tu>>

Returns the element type for this array, complex, or vector type, if applicable.

fn get_offsetof<F: AsRef<str>>(&self, field: F) -> Result<usizeOffsetofError>

Returns the offset of the field with the supplied name in this record type in bits.

Failures

  • this record type is a dependent type
  • this record record type is an incomplete type
  • this record type does not contain a field with the supplied name

fn get_kind(&self) -> TypeKind

Returns the kind of this type.

fn get_pointee_type(&self) -> Option<Type<'tu>>

Returns the pointee type for this pointer type, if applicable.

fn get_ref_qualifier(&self) -> Option<RefQualifier>

Returns the ref qualifier for this C++ function or method type, if applicable.

fn get_result_type(&self) -> Option<Type<'tu>>

Returns the result type for this function or method type, if applicable.

fn get_size(&self) -> Option<usize>

Returns the size of this constant array or vector type, if applicable.

fn get_sizeof(&self) -> Result<usizeSizeofError>

Returns the size of this type in bytes.

Failures

  • this type is a dependent type
  • this type is an incomplete type
  • this type is a variable size type

fn get_template_argument_types(&self) -> Option<Vec<Option<Type<'tu>>>>

Returns the template argument types for this template class specialization type, if applicable.

fn is_const_qualified(&self) -> bool

Returns whether this type is qualified with const.

fn is_pod(&self) -> bool

Returns whether this type is plain old data (POD).

fn is_restrict_qualified(&self) -> bool

Returns whether this type is qualified with restrict.

fn is_variadic(&self) -> bool

Returns whether this type is a variadic function type.

fn is_volatile_qualified(&self) -> bool

Returns whether this type is qualified with volatile.

Trait Implementations

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

fn clone(&self) -> Type<'tu>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

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

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

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

fn eq(&self, other: &Type<'tu>) -> bool

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

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

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

fn fmt(&self, formatter: &mut Formatter) -> Result

Formats the value using the given formatter.