Struct llvm_plugin_inkwell::memory_buffer::MemoryBuffer
source · [−]pub struct MemoryBuffer { /* private fields */ }Implementations
sourceimpl MemoryBuffer
impl MemoryBuffer
pub fn create_from_file(path: &Path) -> Result<Self, LLVMString>
pub fn create_from_stdin() -> Result<Self, LLVMString>
sourcepub fn create_from_memory_range(input: &[u8], name: &str) -> Self
pub fn create_from_memory_range(input: &[u8], name: &str) -> Self
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
sourcepub fn create_from_memory_range_copy(input: &[u8], name: &str) -> Self
pub fn create_from_memory_range_copy(input: &[u8], name: &str) -> Self
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
sourcepub fn as_slice(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_slice(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Gets a byte slice of this MemoryBuffer.
sourcepub fn create_object_file(self) -> Result<ObjectFile, ()>
pub fn create_object_file(self) -> Result<ObjectFile, ()>
Convert this MemoryBuffer into an ObjectFile. LLVM does not currently
provide any way to determine the cause of error if conversion fails.
Trait Implementations
sourceimpl Debug for MemoryBuffer
impl Debug for MemoryBuffer
Auto Trait Implementations
impl RefUnwindSafe for MemoryBuffer
impl !Send for MemoryBuffer
impl !Sync for MemoryBuffer
impl Unpin for MemoryBuffer
impl UnwindSafe for MemoryBuffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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