pub struct Type(_);Expand description
Defines how a value should be laid out in memory.
Implementations§
source§impl Type
impl Type
sourcepub fn get<'a, T>(context: &'a Context) -> &'a Typewhere
T: Compile<'a>,
pub fn get<'a, T>(context: &'a Context) -> &'a Typewhere
T: Compile<'a>,
Get the type given as an LLVM type descriptor in the context given.
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<'a> From<&'a Type> for LLVMTypeRef
impl<'a> From<&'a Type> for LLVMTypeRef
source§fn from(ty: &'a Type) -> LLVMTypeRef
fn from(ty: &'a Type) -> LLVMTypeRef
Converts to this type from the input type.
source§impl<'a> From<&'a mut Type> for LLVMTypeRef
impl<'a> From<&'a mut Type> for LLVMTypeRef
source§fn from(ty: &'a mut Type) -> LLVMTypeRef
fn from(ty: &'a mut Type) -> LLVMTypeRef
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMType> for &'a Type
impl<'a> From<*mut LLVMType> for &'a Type
source§fn from(ty: LLVMTypeRef) -> &'a Type
fn from(ty: LLVMTypeRef) -> &'a Type
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMType> for &'a mut Type
impl<'a> From<*mut LLVMType> for &'a mut Type
source§fn from(ty: LLVMTypeRef) -> &'a mut Type
fn from(ty: LLVMTypeRef) -> &'a mut Type
Converts to this type from the input type.
source§impl GetContext for Type
impl GetContext for Type
source§fn get_context(&self) -> &Context
fn get_context(&self) -> &Context
Returns a reference to the context that owns this value. Read more