[][src]Struct clang::Type

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

The type of an AST entity.

Implementations

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

pub fn get_kind(&self) -> TypeKind[src]

Returns the kind of this type.

pub fn get_display_name(&self) -> String[src]

Returns the display name of this type.

pub fn get_alignof(&self) -> Result<usize, AlignofError>[src]

Returns the alignment of this type in bytes.

Failures

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

pub fn get_offsetof<F: AsRef<str>>(
    &self,
    field: F
) -> Result<usize, OffsetofError>
[src]

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

pub fn get_sizeof(&self) -> Result<usize, SizeofError>[src]

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

pub fn get_address_space(&self) -> usize[src]

Returns the address space of this type.

pub fn get_argument_types(&self) -> Option<Vec<Type<'tu>>>[src]

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

pub fn get_calling_convention(&self) -> Option<CallingConvention>[src]

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

pub fn get_canonical_type(&self) -> Type<'tu>[src]

Returns the canonical type for this type.

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

pub fn get_class_type(&self) -> Option<Type<'tu>>[src]

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

pub fn get_declaration(&self) -> Option<Entity<'tu>>[src]

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

pub fn get_elaborated_type(&self) -> Option<Type<'tu>>[src]

Returns the type named by this elaborated type, if applicable.

pub fn get_element_type(&self) -> Option<Type<'tu>>[src]

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

pub fn get_exception_specification(&self) -> Option<ExceptionSpecification>[src]

Returns the exception specification of this type, if applicable.

pub fn get_fields(&self) -> Option<Vec<Entity<'tu>>>[src]

Returns the fields in this record type, if applicable.

pub fn get_modified_type(&self) -> Option<Type<'tu>>[src]

Return the type that was modified by this attributed type.

pub fn get_nullability(&self) -> Option<Nullability>[src]

Returns the nullability of this pointer type, if applicable.

pub fn get_objc_encoding(&self) -> Option<String>[src]

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

pub fn get_objc_object_base_type(&self) -> Option<Type<'_>>[src]

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

pub fn get_objc_protocol_declarations(&self) -> Vec<Entity<'tu>>[src]

Returns the declarations for all protocol references for this Objective-C type, if applicable.

pub fn get_objc_type_arguments(&self) -> Vec<Type<'tu>>[src]

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

pub fn get_pointee_type(&self) -> Option<Type<'tu>>[src]

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

pub fn get_ref_qualifier(&self) -> Option<RefQualifier>[src]

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

pub fn get_result_type(&self) -> Option<Type<'tu>>[src]

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

pub fn get_size(&self) -> Option<usize>[src]

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

pub fn get_template_argument_types(&self) -> Option<Vec<Option<Type<'tu>>>>[src]

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

pub fn get_typedef_name(&self) -> Option<String>[src]

Returns the typedef name of this type, if applicable.

pub fn is_const_qualified(&self) -> bool[src]

Returns whether this type is qualified with const.

pub fn is_elaborated(&self) -> Option<bool>[src]

Returns whether this type is an elaborated type, if it can be determined for certain.

pub fn is_pod(&self) -> bool[src]

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

pub fn is_restrict_qualified(&self) -> bool[src]

Returns whether this type is qualified with restrict.

pub fn is_transparent_tag(&self) -> bool[src]

Returns whether this type is a transparent tag typedef.

pub fn is_variadic(&self) -> bool[src]

Returns whether this type is a variadic function type.

pub fn is_volatile_qualified(&self) -> bool[src]

Returns whether this type is qualified with volatile.

pub fn visit_fields<F: FnMut(Entity<'tu>) -> bool>(&self, f: F) -> Option<bool>[src]

Visits the fields in this record type, returning None if this type is not a record type and returning Some(b) otherwise where b indicates whether visitation was ended by the callback returning false.

pub fn is_integer(&self) -> bool[src]

Returns whether this type is an integer type.

pub fn is_signed_integer(&self) -> bool[src]

Returns whether this type is a signed integer type.

pub fn is_unsigned_integer(&self) -> bool[src]

Returns whether this type is an unsigned integer type.

Trait Implementations

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

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

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

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

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

Auto Trait Implementations

impl<'tu> RefUnwindSafe for Type<'tu>

impl<'tu> !Send for Type<'tu>

impl<'tu> !Sync for Type<'tu>

impl<'tu> Unpin for Type<'tu>

impl<'tu> UnwindSafe for Type<'tu>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.