[−][src]Struct cranelift_module::DataContext
This is to data objects what cranelift_codegen::Context is to functions.
Methods
impl DataContext[src]
pub fn new() -> Self[src]
Allocate a new context.
pub fn clear(&mut self)[src]
Clear all data structures in this context.
pub fn define_zeroinit(&mut self, size: usize)[src]
Define a zero-initialized object with the given size.
pub fn define(&mut self, contents: Box<[u8]>)[src]
Define an object initialized with the given contents.
TODO: Can we avoid a Box here?
pub fn import_function(&mut self, name: ExternalName) -> FuncRef[src]
Declare an external function import.
Users of the Module API generally should call
Module::declare_func_in_data instead, as it takes care of generating
the appropriate ExternalName.
pub fn import_global_value(&mut self, name: ExternalName) -> GlobalValue[src]
Declares a global value import.
TODO: Rename to import_data?
Users of the Module API generally should call
Module::declare_data_in_data instead, as it takes care of generating
the appropriate ExternalName.
pub fn write_function_addr(&mut self, offset: CodeOffset, func: FuncRef)[src]
Write the address of func into the data at offset offset.
pub fn write_data_addr(
&mut self,
offset: CodeOffset,
data: GlobalValue,
addend: Addend
)[src]
&mut self,
offset: CodeOffset,
data: GlobalValue,
addend: Addend
)
Write the address of data into the data at offset offset.
pub fn description(&self) -> &DataDescription[src]
Reference the initializer data.
Auto Trait Implementations
impl Send for DataContext
impl Sync for DataContext
Blanket Implementations
impl<T> From for T[src]
impl<T, U> TryFrom 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 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, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,