Struct llvm::StructType [] [src]

pub struct StructType;

A structure type, such as a tuple or struct.

Methods

impl StructType
[src]

fn new<'a>(context: &'a Context, fields: &[&'a Type], packed: bool) -> &'a StructType

Make a new struct with the given fields and packed representation.

fn new_named<'a>(context: &'a Context, name: &str, fields: &[&'a Type], packed: bool) -> &'a StructType

Make a new named struct with the given fields and packed representation.

fn get_elements(&self) -> Vec<&Type>

Returns the elements that make up this struct.

Methods from Deref<Target=Type>

fn is_sized(&self) -> bool

Returns true if the size of the type is known at compile-time.

This is equivalent to the type implementing Sized in Rust

fn is_function(&self) -> bool

Returns true if this type is a function.

This is equivalent to FunctionType::is.

fn is_struct(&self) -> bool

Returns true if this type is a struct.

This is equivalent to StructType::is.

fn is_void(&self) -> bool

Returns true if this type is void.

fn is_pointer(&self) -> bool

Returns true if this type is a pointer.

This is equivalent to PointerType::is.

fn is_integer(&self) -> bool

Returns true if this type is an integer.

fn is_float(&self) -> bool

Returns true if this type is any floating-point number.

fn get_size(&self, target: &TargetData) -> usize

Returns the size of the type in bytes.

Trait Implementations

impl Eq for StructType
[src]

impl PartialEq<StructType> for StructType
[src]

fn eq(&self, other: &StructType) -> 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<'a> PartialEq<StructType> for &'a StructType
[src]

fn eq(&self, other: &StructType) -> 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<'a> From<LLVMTypeRef> for &'a StructType
[src]

fn from(ty: LLVMTypeRef) -> &'a StructType

Performs the conversion.

impl<'a> From<LLVMTypeRef> for &'a mut StructType
[src]

fn from(ty: LLVMTypeRef) -> &'a mut StructType

Performs the conversion.

impl GetContext for StructType
[src]

fn get_context(&self) -> &Context

Returns a reference to the context that owns this value. Read more

impl Debug for StructType
[src]

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

Formats the value using the given formatter.

impl Sub<Type> for StructType
[src]

fn is(ty: &Type) -> bool

Check if the given super value is an instance of this type.

fn from_super(c: &T) -> Option<&Self>

Attempt to cast the given super value into an instance of this type.

fn to_super(&self) -> &T

Cast this value to a super value.

impl Deref for StructType
[src]

type Target = Type

The resulting type after dereferencing

fn deref(&self) -> &Type

The method called to dereference a value