Skip to main content

Externs

Trait Externs 

Source
pub trait Externs {
    // Required method
    fn call(&self, ref_: &str, args: &[Value]) -> Result<Value, EvalError>;
}
Expand description

Extern registry: resolves a call_extern.ref against evaluated args and returns the value. Mirror of canonical opts.externs (flow-ir-lua interpreter.lua): each entry MUST be a pure function — no side effects, no flow control, value-shape manipulation only.

Same DI pattern as Dispatcher: host crates provide concrete implementations (ExternMap for plain Rust closures, mlua bridge for Lua functions upstream).

Required Methods§

Source

fn call(&self, ref_: &str, args: &[Value]) -> Result<Value, EvalError>

Invoke the extern registered under ref_ with already-evaluated args. Unregistered refs raise EvalError::ExternError.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§