pub struct Type<'a>(/* private fields */);Expand description
LLVMType wrapper
Implementations§
Source§impl<'a> Type<'a>
impl<'a> Type<'a>
Sourcepub fn of<T: LLVMType<'a>>(ctx: &Context<'a>) -> Result<Type<'a>, Error>
pub fn of<T: LLVMType<'a>>(ctx: &Context<'a>) -> Result<Type<'a>, Error>
Allows for conversion between Rust/LLVM types
Sourcepub fn by_name(
ctx: &'a Context<'_>,
name: impl AsRef<str>,
) -> Result<Type<'a>, Error>
pub fn by_name( ctx: &'a Context<'_>, name: impl AsRef<str>, ) -> Result<Type<'a>, Error>
Get type by name
Sourcepub fn element_type(self) -> Result<Type<'a>, Error>
pub fn element_type(self) -> Result<Type<'a>, Error>
Get type of element
Sourcepub fn to_func_type(self) -> Result<FuncType<'a>, Error>
pub fn to_func_type(self) -> Result<FuncType<'a>, Error>
Convert to function type
Sourcepub fn to_struct_type(self) -> Result<StructType<'a>, Error>
pub fn to_struct_type(self) -> Result<StructType<'a>, Error>
Convert to struct type
Sourcepub fn pointer(self, address_space: Option<usize>) -> Result<Type<'a>, Error>
pub fn pointer(self, address_space: Option<usize>) -> Result<Type<'a>, Error>
Make pointer type
Sourcepub fn vector_len(self) -> usize
pub fn vector_len(self) -> usize
Get vector length
Sourcepub fn pointer_address_space(self) -> usize
pub fn pointer_address_space(self) -> usize
Get pointer address space
Trait Implementations§
Source§impl<'a> AsRef<Type<'a>> for StructType<'a>
impl<'a> AsRef<Type<'a>> for StructType<'a>
Source§impl<'a> From<StructType<'a>> for Type<'a>
impl<'a> From<StructType<'a>> for Type<'a>
Source§fn from(x: StructType<'a>) -> Type<'a>
fn from(x: StructType<'a>) -> Type<'a>
Converts to this type from the input type.
impl<'a> Copy for Type<'a>
Auto Trait Implementations§
impl<'a> Freeze for Type<'a>
impl<'a> RefUnwindSafe for Type<'a>
impl<'a> !Send for Type<'a>
impl<'a> !Sync for Type<'a>
impl<'a> Unpin for Type<'a>
impl<'a> UnwindSafe for Type<'a>
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