Struct llvm_rs::types::FunctionType
source · pub struct FunctionType(_);Expand description
A function signature type.
Implementations§
source§impl FunctionType
impl FunctionType
sourcepub fn new<'a>(ret: &'a Type, args: &[&'a Type]) -> &'a FunctionType
pub fn new<'a>(ret: &'a Type, args: &[&'a Type]) -> &'a FunctionType
Make a new function signature with the return type and arguments given.
sourcepub fn num_params(&self) -> usize
pub fn num_params(&self) -> usize
Returns the number of parameters this signature takes.
sourcepub fn get_params(&self) -> Vec<&Type>
pub fn get_params(&self) -> Vec<&Type>
Returns a vector of this signature’s parameters’ types.
sourcepub fn get_return(&self) -> &Type
pub fn get_return(&self) -> &Type
Returns the type that this function returns.
Methods from Deref<Target = Type>§
sourcepub fn is_sized(&self) -> bool
pub 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
sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this type is a function.
This is equivalent to FunctionType::is.
sourcepub fn is_struct(&self) -> bool
pub fn is_struct(&self) -> bool
Returns true if this type is a struct.
This is equivalent to StructType::is.
sourcepub fn is_pointer(&self) -> bool
pub fn is_pointer(&self) -> bool
Returns true if this type is a pointer.
This is equivalent to PointerType::is.
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this type is an integer.
pub fn get_size(&self, target: &TargetData) -> usize
Trait Implementations§
source§impl Debug for FunctionType
impl Debug for FunctionType
source§impl Deref for FunctionType
impl Deref for FunctionType
source§impl<'a> From<&'a FunctionType> for LLVMTypeRef
impl<'a> From<&'a FunctionType> for LLVMTypeRef
source§fn from(ty: &'a FunctionType) -> LLVMTypeRef
fn from(ty: &'a FunctionType) -> LLVMTypeRef
Converts to this type from the input type.
source§impl<'a> From<&'a mut FunctionType> for LLVMTypeRef
impl<'a> From<&'a mut FunctionType> for LLVMTypeRef
source§fn from(ty: &'a mut FunctionType) -> LLVMTypeRef
fn from(ty: &'a mut FunctionType) -> LLVMTypeRef
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMType> for &'a FunctionType
impl<'a> From<*mut LLVMType> for &'a FunctionType
source§fn from(ty: LLVMTypeRef) -> &'a FunctionType
fn from(ty: LLVMTypeRef) -> &'a FunctionType
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMType> for &'a mut FunctionType
impl<'a> From<*mut LLVMType> for &'a mut FunctionType
source§fn from(ty: LLVMTypeRef) -> &'a mut FunctionType
fn from(ty: LLVMTypeRef) -> &'a mut FunctionType
Converts to this type from the input type.
source§impl GetContext for FunctionType
impl GetContext for FunctionType
source§fn get_context(&self) -> &Context
fn get_context(&self) -> &Context
Returns a reference to the context that owns this value. Read more