Struct llvm_plugin_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<'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<MetadataType<'ctx>> for MetadataType<'ctx>
impl<'ctx> PartialEq<MetadataType<'ctx>> 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 ==.