[−][src]Struct inkwell::attributes::Attribute
Functions, function parameters, and return types can have Attribute
s to indicate
how they should be treated by optimizations and code generation.
Methods
impl Attribute
[src]
pub fn is_enum(&self) -> bool
[src]
Determines whether or not an Attribute
is an enum. This method will
likely be removed in the future in favor of Attribute
s being generically
defined.
Example
use inkwell::context::Context; let context = Context::create(); let enum_attribute = context.create_enum_attribute(0, 10); assert!(enum_attribute.is_enum());
pub fn is_string(&self) -> bool
[src]
Determines whether or not an Attribute
is a string. This method will
likely be removed in the future in favor of Attribute
s being generically
defined.
Example
use inkwell::context::Context; let context = Context::create(); let string_attribute = context.create_string_attribute("my_key_123", "my_val"); assert!(string_attribute.is_string());
pub fn get_named_enum_kind_id(name: &str) -> u32
[src]
Gets the enum kind id associated with a builtin name.
Example
use inkwell::attributes::Attribute; // This kind id doesn't exist: assert_eq!(Attribute::get_named_enum_kind_id("foobar"), 0); // These are real kind ids: assert_eq!(Attribute::get_named_enum_kind_id("align"), 1); assert_eq!(Attribute::get_named_enum_kind_id("builtin"), 5);
pub fn get_enum_kind_id(&self) -> u32
[src]
Gets the kind id associated with an enum Attribute
.
Example
use inkwell::context::Context; let context = Context::create(); let enum_attribute = context.create_enum_attribute(0, 10); assert_eq!(enum_attribute.get_enum_kind_id(), 0);
pub fn get_last_enum_kind_id() -> u32
[src]
Gets the last enum kind id associated with builtin names.
Example
use inkwell::attributes::Attribute; assert_eq!(Attribute::get_last_enum_kind_id(), 56);
pub fn get_enum_value(&self) -> u64
[src]
Gets the value associated with an enum Attribute
.
Example
use inkwell::context::Context; let context = Context::create(); let enum_attribute = context.create_enum_attribute(0, 10); assert_eq!(enum_attribute.get_enum_value(), 10);
pub fn get_string_kind_id(&self) -> &CStr
[src]
Gets the string kind id associated with a string attribute.
Example
use inkwell::context::Context; use std::ffi::CString; let context = Context::create(); let string_attribute = context.create_string_attribute("my_key", "my_val"); assert_eq!(*string_attribute.get_string_kind_id(), *CString::new("my_key").unwrap());
pub fn get_string_value(&self) -> &CStr
[src]
Gets the string value associated with a string attribute.
Example
use inkwell::context::Context; use std::ffi::CString; let context = Context::create(); let string_attribute = context.create_string_attribute("my_key", "my_val"); assert_eq!(*string_attribute.get_string_value(), *CString::new("my_val").unwrap());
Trait Implementations
impl Clone for Attribute
[src]
impl PartialEq<Attribute> for Attribute
[src]
impl Copy for Attribute
[src]
impl Debug for Attribute
[src]
Auto Trait Implementations
impl !Sync for Attribute
impl !Send for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
impl RefUnwindSafe for Attribute
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,