Trait WasmFunctionCaller

Source
pub trait WasmFunctionCaller: Send + Sync {
    // Required methods
    fn call_function_json(
        &self,
        function_name: &str,
        params_json: &str,
    ) -> Result<String>;
    fn call_function_msgpack(
        &self,
        function_name: &str,
        params_msgpack: &[u8],
    ) -> Result<Vec<u8>>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

Separate trait for generic/async function calling (dyn-compatible)

Required Methods§

Source

fn call_function_json( &self, function_name: &str, params_json: &str, ) -> Result<String>

Call a function in the instance with JSON serialization

Source

fn call_function_msgpack( &self, function_name: &str, params_msgpack: &[u8], ) -> Result<Vec<u8>>

Call a function in the instance with MessagePack serialization

Source

fn as_any(&self) -> &dyn Any

Get a reference to Any for downcasting

Implementors§