Struct llvm_plugin_inkwell::types::VoidType
source · pub struct VoidType<'ctx> { /* private fields */ }Expand description
A VoidType is a special type with no possible direct instances. It’s only
useful as a function return type.
Implementations§
source§impl<'ctx> VoidType<'ctx>
impl<'ctx> VoidType<'ctx>
sourcepub unsafe fn new(void_type: LLVMTypeRef) -> Self
pub unsafe fn new(void_type: LLVMTypeRef) -> Self
sourcepub fn is_sized(self) -> bool
pub fn is_sized(self) -> bool
Gets whether or not this VoidType is sized or not. This may always
be false and as such this function may be removed in the future.
Example
use inkwell::context::Context;
let context = Context::create();
let void_type = context.void_type();
assert!(void_type.is_sized());sourcepub fn get_context(self) -> ContextRef<'ctx>
pub fn get_context(self) -> ContextRef<'ctx>
Gets a reference to the Context this VoidType was created in.
Example
use inkwell::context::Context;
let context = Context::create();
let void_type = context.void_type();
assert_eq!(void_type.get_context(), context);sourcepub fn fn_type(
self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
pub fn fn_type(
self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
Creates a FunctionType with this VoidType for its return type.
This means the function does not return.
Example
use inkwell::context::Context;
let context = Context::create();
let void_type = context.void_type();
let fn_type = void_type.fn_type(&[], false);sourcepub fn print_to_string(self) -> LLVMString
pub fn print_to_string(self) -> LLVMString
Print the definition of a VoidType to LLVMString.
Trait Implementations§
source§impl<'ctx> AnyType<'ctx> for VoidType<'ctx>
impl<'ctx> AnyType<'ctx> for VoidType<'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<'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.