Trait DiffEngine

Source
pub trait DiffEngine {
    // Required methods
    fn name(&self) -> &'static str;
    fn instantiate(&mut self, wasm: &[u8]) -> Result<Box<dyn DiffInstance>>;
    fn assert_error_match(&self, err: &Error, trap: &Trap);
    fn is_non_deterministic_error(&self, err: &Error) -> bool;
}
Expand description

Provide a way to instantiate Wasm modules.

Required Methods§

Source

fn name(&self) -> &'static str

Return the name of the engine.

Source

fn instantiate(&mut self, wasm: &[u8]) -> Result<Box<dyn DiffInstance>>

Create a new instance with the given engine.

Source

fn assert_error_match(&self, err: &Error, trap: &Trap)

Tests that the wasmtime-originating trap matches the error this engine generated.

Source

fn is_non_deterministic_error(&self, err: &Error) -> bool

Returns whether the error specified from this engine is non-deterministic, like a stack overflow or an attempt to allocate an object that is too large (which is non-deterministic because it may depend on which collector it was configured with or memory available on the system).

Implementors§