mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-03 18:11:41 +00:00
nop externals
This commit is contained in:
parent
0db8f109b3
commit
f773c61cb1
@ -44,15 +44,15 @@ pub trait Externals {
|
||||
fn check_signature(&self, index: HostFuncIndex, signature: &FunctionType) -> bool;
|
||||
}
|
||||
|
||||
pub struct EmptyExternals;
|
||||
pub struct NopExternals;
|
||||
|
||||
impl Externals for EmptyExternals {
|
||||
impl Externals for NopExternals {
|
||||
fn invoke_index(
|
||||
&mut self,
|
||||
_index: HostFuncIndex,
|
||||
_args: &[RuntimeValue],
|
||||
) -> Result<Option<RuntimeValue>, Error> {
|
||||
Err(Error::Trap("invoke index on empty externals".into()))
|
||||
Err(Error::Trap("invoke index on no-op externals".into()))
|
||||
}
|
||||
|
||||
fn check_signature(&self, _index: HostFuncIndex, _signature: &FunctionType) -> bool {
|
||||
|
@ -123,7 +123,7 @@ pub use self::memory::{MemoryInstance, MemoryRef};
|
||||
pub use self::table::{TableInstance, TableRef};
|
||||
pub use self::program::ProgramInstance;
|
||||
pub use self::value::{RuntimeValue, TryInto};
|
||||
pub use self::host::{Externals, HostFuncIndex, EmptyExternals, HostError};
|
||||
pub use self::host::{Externals, HostFuncIndex, NopExternals, HostError};
|
||||
pub use self::imports::{ImportResolver, Imports};
|
||||
pub use self::module::{ModuleInstance, ModuleRef, ExternVal};
|
||||
pub use self::global::{GlobalInstance, GlobalRef};
|
||||
|
Loading…
x
Reference in New Issue
Block a user