pub struct Type<'a>(_, _);Expand description
LLVMType wrapper
Implementations
sourceimpl<'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
sourceimpl<'a> AsRef<Type<'a>> for StructType<'a>
impl<'a> AsRef<Type<'a>> for StructType<'a>
sourceimpl<'a> From<StructType<'a>> for Type<'a>
impl<'a> From<StructType<'a>> for Type<'a>
sourcefn 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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more