[][src]Struct cranelift_module::DataContext

pub struct DataContext { /* fields omitted */ }

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]

Write the address of data into the data at offset offset.

pub fn description(&self) -> &DataDescription[src]

Reference the initializer data.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.