Skip to main content

RuntimeAdapter

Trait RuntimeAdapter 

Source
pub trait RuntimeAdapter: Send + Sync {
    // Required methods
    fn execute(&self, script: &str, input: &Value) -> Result<Value, String>;
    fn name(&self) -> &str;
}
Expand description

Trait for executing a PCard binding script.

Each runtime type (shell, python, node, llm, echo, noop, math) implements this trait. The dispatcher looks up the runtime by name and calls execute.

Required Methods§

Source

fn execute(&self, script: &str, input: &Value) -> Result<Value, String>

Execute the script with the given input and return the output.

Source

fn name(&self) -> &str

Human-readable name of this adapter (e.g. “shell”, “python”, “wasm”).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§