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 AsTypeRef for VoidType<'_>
impl AsTypeRef for VoidType<'_>
source§fn as_type_ref(&self) -> LLVMTypeRef
fn as_type_ref(&self) -> LLVMTypeRef
Returns the internal LLVM reference behind the type
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.
source§impl<'ctx> PartialEq for VoidType<'ctx>
impl<'ctx> PartialEq for VoidType<'ctx>
source§impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VoidType<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for VoidType<'ctx>
impl<'ctx> Copy for VoidType<'ctx>
impl<'ctx> Eq for VoidType<'ctx>
impl<'ctx> StructuralPartialEq for VoidType<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for VoidType<'ctx>
impl<'ctx> RefUnwindSafe for VoidType<'ctx>
impl<'ctx> !Send for VoidType<'ctx>
impl<'ctx> !Sync for VoidType<'ctx>
impl<'ctx> Unpin for VoidType<'ctx>
impl<'ctx> UnwindSafe for VoidType<'ctx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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