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>

source

pub unsafe fn new(type_: LLVMTypeRef) -> Self

Create AnyTypeEnum from LLVMTypeRef

§Safety

Undefined behavior, if referenced type isn’t part of AnyTypeEnum

source

pub fn into_array_type(self) -> ArrayType<'ctx>

source

pub fn into_float_type(self) -> FloatType<'ctx>

source

pub fn into_function_type(self) -> FunctionType<'ctx>

source

pub fn into_int_type(self) -> IntType<'ctx>

source

pub fn into_pointer_type(self) -> PointerType<'ctx>

source

pub fn into_struct_type(self) -> StructType<'ctx>

source

pub fn into_vector_type(self) -> VectorType<'ctx>

source

pub fn into_void_type(self) -> VoidType<'ctx>

source

pub fn is_array_type(self) -> bool

source

pub fn is_float_type(self) -> bool

source

pub fn is_function_type(self) -> bool

source

pub fn is_int_type(self) -> bool

source

pub fn is_pointer_type(self) -> bool

source

pub fn is_struct_type(self) -> bool

source

pub fn is_vector_type(self) -> bool

source

pub fn is_void_type(self) -> bool

source

pub fn size_of(&self) -> Option<IntValue<'ctx>>

source

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>

source§

fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>

Returns an AnyTypeEnum that represents the current type.
source§

fn print_to_string(&self) -> LLVMString

Prints the definition of a Type to a LLVMString.
source§

impl AsTypeRef for AnyTypeEnum<'_>

source§

fn as_type_ref(&self) -> LLVMTypeRef

Returns the internal LLVM reference behind the type
source§

impl<'ctx> Clone for AnyTypeEnum<'ctx>

source§

fn clone(&self) -> AnyTypeEnum<'ctx>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'ctx> Debug for AnyTypeEnum<'ctx>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AnyTypeEnum<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'ctx> From<ArrayType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: ArrayType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<FloatType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: FloatType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<FunctionType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: FunctionType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<IntType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: IntType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<PointerType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: PointerType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<StructType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: StructType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<VectorType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: VectorType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> From<VoidType<'ctx>> for AnyTypeEnum<'ctx>

source§

fn from(value: VoidType<'_>) -> AnyTypeEnum<'_>

Converts to this type from the input type.
source§

impl<'ctx> PartialEq for AnyTypeEnum<'ctx>

source§

fn eq(&self, other: &AnyTypeEnum<'ctx>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for ArrayType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicMetadataTypeEnum<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicTypeEnum<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FloatType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for FunctionType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for IntType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for PointerType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for StructType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VectorType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VoidType<'ctx>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'ctx> Copy for AnyTypeEnum<'ctx>

source§

impl<'ctx> Eq for AnyTypeEnum<'ctx>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.