Enum inkwell::types::AnyTypeEnum
source · pub enum AnyTypeEnum<'ctx> {
ArrayType(ArrayType<'ctx>),
FloatType(FloatType<'ctx>),
FunctionType(FunctionType<'ctx>),
IntType(IntType<'ctx>),
PointerType(PointerType<'ctx>),
StructType(StructType<'ctx>),
VectorType(VectorType<'ctx>),
VoidType(VoidType<'ctx>),
}
Expand description
A wrapper for any BasicType
, VoidType
, or FunctionType
.
Variants§
ArrayType(ArrayType<'ctx>)
A contiguous homogeneous container type.
FloatType(FloatType<'ctx>)
A floating point type.
FunctionType(FunctionType<'ctx>)
A function return and parameter definition.
IntType(IntType<'ctx>)
An integer type.
PointerType(PointerType<'ctx>)
A pointer type.
StructType(StructType<'ctx>)
A contiguous heterogeneous container type.
VectorType(VectorType<'ctx>)
A contiguous homogeneous “SIMD” container type.
VoidType(VoidType<'ctx>)
A valueless type.
Implementations§
source§impl<'ctx> AnyTypeEnum<'ctx>
impl<'ctx> AnyTypeEnum<'ctx>
sourcepub unsafe fn new(type_: LLVMTypeRef) -> Self
pub unsafe fn new(type_: LLVMTypeRef) -> Self
Create AnyTypeEnum
from LLVMTypeRef
Safety
Undefined behavior, if referenced type isn’t part of AnyTypeEnum
pub fn into_array_type(self) -> ArrayType<'ctx>
pub fn into_float_type(self) -> FloatType<'ctx>
pub fn into_function_type(self) -> FunctionType<'ctx>
pub fn into_int_type(self) -> IntType<'ctx>
pub fn into_pointer_type(self) -> PointerType<'ctx>
pub fn into_struct_type(self) -> StructType<'ctx>
pub fn into_vector_type(self) -> VectorType<'ctx>
pub fn into_void_type(self) -> VoidType<'ctx>
pub fn is_array_type(self) -> bool
pub fn is_float_type(self) -> bool
pub fn is_function_type(self) -> bool
pub fn is_int_type(self) -> bool
pub fn is_pointer_type(self) -> bool
pub fn is_struct_type(self) -> bool
pub fn is_vector_type(self) -> bool
pub fn is_void_type(self) -> bool
pub fn size_of(&self) -> Option<IntValue<'ctx>>
sourcepub fn print_to_string(self) -> LLVMString
pub fn print_to_string(self) -> LLVMString
Print the definition of a AnyTypeEnum
to LLVMString
.
Trait Implementations§
source§impl<'ctx> AnyType<'ctx> for AnyTypeEnum<'ctx>
impl<'ctx> AnyType<'ctx> for AnyTypeEnum<'ctx>
source§fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
Returns an
AnyTypeEnum
that represents the current type.source§fn print_to_string(&self) -> LLVMString
fn print_to_string(&self) -> LLVMString
Prints the definition of a Type to a
LLVMString
.source§impl AsTypeRef for AnyTypeEnum<'_>
impl AsTypeRef for AnyTypeEnum<'_>
source§fn as_type_ref(&self) -> LLVMTypeRef
fn as_type_ref(&self) -> LLVMTypeRef
Returns the internal LLVM reference behind the type
source§impl<'ctx> Clone for AnyTypeEnum<'ctx>
impl<'ctx> Clone for AnyTypeEnum<'ctx>
source§fn clone(&self) -> AnyTypeEnum<'ctx>
fn clone(&self) -> AnyTypeEnum<'ctx>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'ctx> Debug for AnyTypeEnum<'ctx>
impl<'ctx> Debug for AnyTypeEnum<'ctx>
source§impl Display for AnyTypeEnum<'_>
impl Display for AnyTypeEnum<'_>
source§impl<'ctx> From<ArrayType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<ArrayType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: ArrayType<'_>) -> AnyTypeEnum<'_>
fn from(value: ArrayType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<FloatType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<FloatType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: FloatType<'_>) -> AnyTypeEnum<'_>
fn from(value: FloatType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<FunctionType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<FunctionType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: FunctionType<'_>) -> AnyTypeEnum<'_>
fn from(value: FunctionType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<IntType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<IntType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: IntType<'_>) -> AnyTypeEnum<'_>
fn from(value: IntType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<PointerType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<PointerType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: PointerType<'_>) -> AnyTypeEnum<'_>
fn from(value: PointerType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<StructType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<StructType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: StructType<'_>) -> AnyTypeEnum<'_>
fn from(value: StructType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<VectorType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<VectorType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: VectorType<'_>) -> AnyTypeEnum<'_>
fn from(value: VectorType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> From<VoidType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<VoidType<'ctx>> for AnyTypeEnum<'ctx>
source§fn from(value: VoidType<'_>) -> AnyTypeEnum<'_>
fn from(value: VoidType<'_>) -> AnyTypeEnum<'_>
Converts to this type from the input type.
source§impl<'ctx> PartialEq for AnyTypeEnum<'ctx>
impl<'ctx> PartialEq for AnyTypeEnum<'ctx>
source§fn eq(&self, other: &AnyTypeEnum<'ctx>) -> bool
fn eq(&self, other: &AnyTypeEnum<'ctx>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for ArrayType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for ArrayType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicMetadataTypeEnum<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicMetadataTypeEnum<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FloatType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FloatType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FunctionType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FunctionType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for IntType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for IntType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for PointerType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for PointerType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for StructType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for StructType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VectorType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VectorType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VoidType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VoidType<'ctx>
impl<'ctx> Copy for AnyTypeEnum<'ctx>
impl<'ctx> Eq for AnyTypeEnum<'ctx>
impl<'ctx> StructuralEq for AnyTypeEnum<'ctx>
impl<'ctx> StructuralPartialEq for AnyTypeEnum<'ctx>
Auto Trait Implementations§
impl<'ctx> RefUnwindSafe for AnyTypeEnum<'ctx>
impl<'ctx> !Send for AnyTypeEnum<'ctx>
impl<'ctx> !Sync for AnyTypeEnum<'ctx>
impl<'ctx> Unpin for AnyTypeEnum<'ctx>
impl<'ctx> UnwindSafe for AnyTypeEnum<'ctx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more