Struct cranelift_wasm::DummyEnvironment[][src]

pub struct DummyEnvironment {
    pub info: DummyModuleInfo,
    pub func_bytecode_sizes: Vec<usize>,
    pub module_name: Option<String>,
    // 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.

module_name: Option<String>

Name of the module from the wasm file.

Implementations

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.

pub fn get_func_name(&self, func_index: FuncIndex) -> Option<&str>[src]

Return the name of the function, if a name for the function with the corresponding index exists.

pub fn test_expected_reachability(&mut self, reachability: Vec<(bool, bool)>)[src]

Test reachability bits before and after every opcode during translation, as provided by the FuncTranslationState. This is generally used only for unit tests. This is applied to every function in the module (so is likely only useful for test modules with one function).

Trait Implementations

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

impl TargetEnvironment for DummyEnvironment[src]

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.