inkwell::types

Enum 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>),
    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>

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_scalable_vector_type(self) -> ScalableVectorType<'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<ScalableVectorType<'ctx>> for AnyTypeEnum<'ctx>

Source§

fn from(value: ScalableVectorType<'_>) -> 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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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 ScalableVectorType<'ctx>

Source§

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>

Source§

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>

Source§

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>

Source§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.