pub struct MetadataType<'ctx> { /* private fields */ }
Expand description
A MetadataType
is the type of a metadata.
Implementations§
Source§impl<'ctx> MetadataType<'ctx>
impl<'ctx> MetadataType<'ctx>
Sourcepub unsafe fn new(metadata_type: LLVMTypeRef) -> Self
Available on crate features llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.
pub unsafe fn new(metadata_type: LLVMTypeRef) -> Self
llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.Create MetadataType
from LLVMTypeRef
§Safety
Undefined behavior, if referenced type isn’t metadata type
Sourcepub fn fn_type(
self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool,
) -> FunctionType<'ctx>
Available on crate features llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.
pub fn fn_type( self, param_types: &[BasicMetadataTypeEnum<'ctx>], is_var_args: bool, ) -> FunctionType<'ctx>
llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.Creates a FunctionType
with this MetadataType
for its return type.
§Example
use inkwell::context::Context;
let context = Context::create();
let md_type = context.metadata_type();
let fn_type = md_type.fn_type(&[], false);
Sourcepub fn get_context(self) -> ContextRef<'ctx>
Available on crate features llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.
pub fn get_context(self) -> ContextRef<'ctx>
llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
or llvm13-0
or llvm14-0
or llvm15-0
or llvm16-0
or llvm17-0
or llvm18-0
only.Gets a reference to the Context
this MetadataType
was created in.
§Example
use inkwell::context::Context;
let context = Context::create();
let md_type = context.metadata_type();
assert_eq!(md_type.get_context(), context);
Sourcepub fn print_to_string(self) -> LLVMString
pub fn print_to_string(self) -> LLVMString
Print the definition of a MetadataType
to LLVMString
.
Trait Implementations§
Source§impl AsTypeRef for MetadataType<'_>
impl AsTypeRef for MetadataType<'_>
Source§fn as_type_ref(&self) -> LLVMTypeRef
fn as_type_ref(&self) -> LLVMTypeRef
Returns the internal LLVM reference behind the type
Source§impl<'ctx> Clone for MetadataType<'ctx>
impl<'ctx> Clone for MetadataType<'ctx>
Source§fn clone(&self) -> MetadataType<'ctx>
fn clone(&self) -> MetadataType<'ctx>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'ctx> Debug for MetadataType<'ctx>
impl<'ctx> Debug for MetadataType<'ctx>
Source§impl Display for MetadataType<'_>
impl Display for MetadataType<'_>
Source§impl<'ctx> From<MetadataType<'ctx>> for BasicMetadataTypeEnum<'ctx>
impl<'ctx> From<MetadataType<'ctx>> for BasicMetadataTypeEnum<'ctx>
Source§fn from(value: MetadataType<'_>) -> BasicMetadataTypeEnum<'_>
fn from(value: MetadataType<'_>) -> BasicMetadataTypeEnum<'_>
Converts to this type from the input type.
Source§impl<'ctx> PartialEq for MetadataType<'ctx>
impl<'ctx> PartialEq for MetadataType<'ctx>
Source§impl<'ctx> TryFrom<BasicMetadataTypeEnum<'ctx>> for MetadataType<'ctx>
impl<'ctx> TryFrom<BasicMetadataTypeEnum<'ctx>> for MetadataType<'ctx>
impl<'ctx> Copy for MetadataType<'ctx>
impl<'ctx> Eq for MetadataType<'ctx>
impl<'ctx> StructuralPartialEq for MetadataType<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for MetadataType<'ctx>
impl<'ctx> RefUnwindSafe for MetadataType<'ctx>
impl<'ctx> !Send for MetadataType<'ctx>
impl<'ctx> !Sync for MetadataType<'ctx>
impl<'ctx> Unpin for MetadataType<'ctx>
impl<'ctx> UnwindSafe for MetadataType<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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