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>),
ScalableVectorType(ScalableVectorType<'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.
ScalableVectorType(ScalableVectorType<'ctx>)
A contiguous homogenous scalable “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_scalable_vector_type(self) -> ScalableVectorType<'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<ScalableVectorType<'ctx>> for AnyTypeEnum<'ctx>
impl<'ctx> From<ScalableVectorType<'ctx>> for AnyTypeEnum<'ctx>
Source§fn from(value: ScalableVectorType<'_>) -> AnyTypeEnum<'_>
fn from(value: ScalableVectorType<'_>) -> 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§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 ScalableVectorType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for ScalableVectorType<'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> StructuralPartialEq for AnyTypeEnum<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for AnyTypeEnum<'ctx>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more