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§
Sourcefn instantiate(&mut self, wasm: &[u8]) -> Result<Box<dyn DiffInstance>>
fn instantiate(&mut self, wasm: &[u8]) -> Result<Box<dyn DiffInstance>>
Create a new instance with the given engine.
Sourcefn assert_error_match(&self, err: &Error, trap: &Trap)
fn assert_error_match(&self, err: &Error, trap: &Trap)
Tests that the wasmtime-originating trap
matches the error this engine
generated.
Sourcefn is_non_deterministic_error(&self, err: &Error) -> bool
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).