[][src]Struct cranelift_wasm::DummyEnvironment

pub struct DummyEnvironment {
    pub info: DummyModuleInfo,
    pub func_bytecode_sizes: Vec<usize>,
    // some fields omitted
}

This ModuleEnvironment implementation is a "naïve" one, doing essentially nothing and emitting placeholders when forced to. Don't try to execute code translated for this environment, essentially here for translation debug purposes.

Fields

info: DummyModuleInfo

Module information.

func_bytecode_sizes: Vec<usize>

Vector of wasm bytecode size for each function.

Methods

impl DummyEnvironment[src]

pub fn new(
    config: TargetFrontendConfig,
    return_mode: ReturnMode,
    debug_info: bool
) -> Self
[src]

Creates a new DummyEnvironment instance.

pub fn func_env(&self) -> DummyFuncEnvironment[src]

Return a DummyFuncEnvironment for translating functions within this DummyEnvironment.

pub fn get_num_func_imports(&self) -> usize[src]

Return the number of imported functions within this DummyEnvironment.

Trait Implementations

impl<'data> ModuleEnvironment<'data> for DummyEnvironment[src]

fn reserve_signatures(&mut self, _num: u32)[src]

Provides the number of signatures up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_imports(&mut self, _num: u32)[src]

Provides the number of imports up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn finish_imports(&mut self)[src]

Notifies the implementation that all imports have been declared.

fn reserve_func_types(&mut self, _num: u32)[src]

Provides the number of defined functions up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_tables(&mut self, _num: u32)[src]

Provides the number of defined tables up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_memories(&mut self, _num: u32)[src]

Provides the number of defined memories up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_globals(&mut self, _num: u32)[src]

Provides the number of defined globals up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_exports(&mut self, _num: u32)[src]

Provides the number of exports up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn finish_exports(&mut self)[src]

Notifies the implementation that all exports have been declared.

fn reserve_table_elements(&mut self, _num: u32)[src]

Provides the number of element initializers up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

fn reserve_data_initializers(&mut self, _num: u32)[src]

Provides the number of data initializers up front. By default this does nothing, but implementations can use this to preallocate memory if desired. Read more

Auto Trait Implementations

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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