Struct inkwell::types::ArrayType [−][src]
An ArrayType
is the type of contiguous constants or variables.
Implementations
impl<'ctx> ArrayType<'ctx>
[src]
pub fn size_of(self) -> Option<IntValue<'ctx>>
[src]
Gets the size of this ArrayType
. Value may vary depending on the target architecture.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_type_size = i8_array_type.size_of();
pub fn get_alignment(self) -> IntValue<'ctx>
[src]
Gets the alignment of this ArrayType
. Value may vary depending on the target architecture.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_type_alignment = i8_array_type.get_alignment();
pub fn ptr_type(self, address_space: AddressSpace) -> PointerType<'ctx>
[src]
Creates a PointerType
with this ArrayType
for its element type.
Example
use inkwell::context::Context; use inkwell::AddressSpace; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_ptr_type = i8_array_type.ptr_type(AddressSpace::Generic); assert_eq!(i8_array_ptr_type.get_element_type().into_array_type(), i8_array_type);
pub fn get_context(self) -> ContextRef<'ctx>
[src]
Gets a reference to the Context
this ArrayType
was created in.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); assert_eq!(*i8_array_type.get_context(), context);
pub fn fn_type(
self,
param_types: &[BasicTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
[src]
self,
param_types: &[BasicTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
Creates a FunctionType
with this ArrayType
for its return type.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let fn_type = i8_array_type.fn_type(&[], false);
pub fn array_type(self, size: u32) -> ArrayType<'ctx>
[src]
Creates an ArrayType
with this ArrayType
for its element type.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_array_type = i8_array_type.array_type(3); assert_eq!(i8_array_array_type.len(), 3); assert_eq!(i8_array_array_type.get_element_type().into_array_type(), i8_array_type);
pub fn const_array(self, values: &[ArrayValue<'ctx>]) -> ArrayValue<'ctx>
[src]
Creates a constant ArrayValue
.
Example
use inkwell::context::Context; let context = Context::create(); let f32_type = context.f32_type(); let f32_array_type = f32_type.array_type(3); let f32_array_val = f32_array_type.const_zero(); let f32_array_array = f32_array_type.const_array(&[f32_array_val, f32_array_val]); assert!(f32_array_array.is_const());
pub fn const_zero(self) -> ArrayValue<'ctx>
[src]
Creates a constant zero value of this ArrayType
.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_zero = i8_array_type.const_zero();
pub fn len(self) -> u32
[src]
Gets the length of this ArrayType
.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); assert_eq!(i8_array_type.len(), 3);
pub fn get_undef(self) -> ArrayValue<'ctx>
[src]
Creates an undefined instance of a ArrayType
.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); let i8_array_undef = i8_array_type.get_undef(); assert!(i8_array_undef.is_undef());
pub fn get_element_type(self) -> BasicTypeEnum<'ctx>
[src]
Gets the element type of this ArrayType
.
Example
use inkwell::context::Context; let context = Context::create(); let i8_type = context.i8_type(); let i8_array_type = i8_type.array_type(3); assert_eq!(i8_array_type.get_element_type().into_int_type(), i8_type);
Trait Implementations
impl<'ctx> AnyType<'ctx> for ArrayType<'ctx>
[src]
fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
[src]
fn print_to_string(&self) -> LLVMString
[src]
impl<'ctx> BasicType<'ctx> for ArrayType<'ctx>
[src]
fn as_basic_type_enum(&self) -> BasicTypeEnum<'ctx>
[src]
fn fn_type(
&self,
param_types: &[BasicTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
[src]
&self,
param_types: &[BasicTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
fn is_sized(&self) -> bool
[src]
fn size_of(&self) -> Option<IntValue<'ctx>>
[src]
fn array_type(&self, size: u32) -> ArrayType<'ctx>
[src]
fn ptr_type(&self, address_space: AddressSpace) -> PointerType<'ctx>
[src]
impl<'ctx> Clone for ArrayType<'ctx>
[src]
impl<'ctx> Copy for ArrayType<'ctx>
[src]
impl<'ctx> Debug for ArrayType<'ctx>
[src]
impl<'ctx> Eq for ArrayType<'ctx>
[src]
impl<'ctx> From<ArrayType<'ctx>> for AnyTypeEnum<'ctx>
[src]
fn from(value: ArrayType<'_>) -> AnyTypeEnum<'_>
[src]
impl<'ctx> From<ArrayType<'ctx>> for BasicTypeEnum<'ctx>
[src]
fn from(value: ArrayType<'_>) -> BasicTypeEnum<'_>
[src]
impl<'ctx> PartialEq<ArrayType<'ctx>> for ArrayType<'ctx>
[src]
fn eq(&self, other: &ArrayType<'ctx>) -> bool
[src]
fn ne(&self, other: &ArrayType<'ctx>) -> bool
[src]
impl<'ctx> StructuralEq for ArrayType<'ctx>
[src]
impl<'ctx> StructuralPartialEq for ArrayType<'ctx>
[src]
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for ArrayType<'ctx>
[src]
type Error = ()
The type returned in the event of a conversion error.
fn try_from(value: AnyTypeEnum<'ctx>) -> Result<Self, Self::Error>
[src]
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for ArrayType<'ctx>
[src]
Auto Trait Implementations
impl<'ctx> RefUnwindSafe for ArrayType<'ctx>
impl<'ctx> !Send for ArrayType<'ctx>
impl<'ctx> !Sync for ArrayType<'ctx>
impl<'ctx> Unpin for ArrayType<'ctx>
impl<'ctx> UnwindSafe for ArrayType<'ctx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,