Skip to main content

ExternalFnHandler

Trait ExternalFnHandler 

Source
pub trait ExternalFnHandler {
    // Required method
    fn call(&self, name: &str, args: &[Value]) -> ExternalResult;
}
Expand description

Trait for handling external function calls from ink.

Implement this to provide runtime-injected external function behavior. The orchestration layer calls call when the VM encounters a CallExternal opcode. The handler can resolve the call immediately, decline to handle it (triggering fallback), or in the future, indicate that resolution is pending (async/WASM).

Required Methods§

Source

fn call(&self, name: &str, args: &[Value]) -> ExternalResult

Handle an external function call.

name is the ink-declared function name. args are the values popped from the value stack, in declaration order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§