[−][src]Struct inkwell::memory_buffer::MemoryBuffer
Methods
impl MemoryBuffer
[src]
pub fn create_from_file(path: &Path) -> Result<Self, LLVMString>
[src]
pub fn create_from_stdin() -> Result<Self, LLVMString>
[src]
pub fn create_from_memory_range(input: &str, name: &str) -> Self
[src]
This will create a new MemoryBuffer
from the given input.
This function is likely slightly cheaper than create_from_memory_range_copy
since it intentionally
leaks data to LLVM so that it doesn't have to reallocate. create_from_memory_range_copy
may be removed
in the future
pub fn create_from_memory_range_copy(input: &str, name: &str) -> Self
[src]
This will create a new MemoryBuffer
from the given input.
This function is likely slightly more expensive than create_from_memory_range
since it does not leak
data to LLVM, forcing LLVM to make a copy. This function may be removed in the future in favor of
create_from_memory_range
pub fn as_slice(&self) -> &[u8]
[src]
Gets a byte slice of this MemoryBuffer
.
pub fn get_size(&self) -> usize
[src]
Gets the byte size of this MemoryBuffer
.
pub fn create_object_file(self) -> Result<ObjectFile, ()>
[src]
Convert this MemoryBuffer
into an ObjectFile
. LLVM does not currently
provide any way to determine the cause of error if conversion fails.
Trait Implementations
impl Drop for MemoryBuffer
[src]
impl Debug for MemoryBuffer
[src]
Auto Trait Implementations
impl !Sync for MemoryBuffer
impl !Send for MemoryBuffer
impl Unpin for MemoryBuffer
impl UnwindSafe for MemoryBuffer
impl RefUnwindSafe for MemoryBuffer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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,