pub enum BasicTypeEnum<'ctx> {
    ArrayType(ArrayType<'ctx>),
    FloatType(FloatType<'ctx>),
    IntType(IntType<'ctx>),
    PointerType(PointerType<'ctx>),
    StructType(StructType<'ctx>),
    VectorType(VectorType<'ctx>),
}
Expand description

A wrapper for any BasicType.

Variants

ArrayType(ArrayType<'ctx>)

A contiguous homogeneous container type.

FloatType(FloatType<'ctx>)

A floating point type.

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.

Implementations

Creates a constant BasicValueZero.

Example
use inkwell::context::Context;
use crate::inkwell::types::BasicType;

let context = Context::create();
let f32_type = context.f32_type().as_basic_type_enum();
let f32_zero = f32_type.const_zero();

Print the definition of a BasicTypeEnum to LLVMString.

Trait Implementations

Returns an AnyTypeEnum that represents the current type.

Prints the definition of a Type to a LLVMString.

Returns a BasicTypeEnum that represents the current type.

Create a FunctionType with this BasicType as its return type. Read more

Determines whether or not this BasicType is sized or not. For example, opaque structs are unsized. Read more

Gets the size of this BasicType. Value may vary depending on the target architecture. Read more

Create an ArrayType with this BasicType as its elements. Read more

Create a PointerType that points to this BasicType. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.