Struct inkwell::types::MetadataType
source · 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
pub unsafe fn new(metadata_type: LLVMTypeRef) -> Self
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>
pub fn fn_type( self, param_types: &[BasicMetadataTypeEnum<'ctx>], is_var_args: bool ) -> FunctionType<'ctx>
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>
pub fn get_context(self) -> ContextRef<'ctx>
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§fn eq(&self, other: &MetadataType<'ctx>) -> bool
fn eq(&self, other: &MetadataType<'ctx>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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> StructuralEq for MetadataType<'ctx>
impl<'ctx> StructuralPartialEq for MetadataType<'ctx>
Auto Trait Implementations§
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