pub trait PatchAdapter: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute(
&self,
label: &str,
frame: &HashMap<String, Value>,
) -> Result<Value, String>;
// Provided method
fn execute_patch(
&self,
ctx: &PatchDispatchContext<'_>,
) -> Result<Value, String> { ... }
}Expand description
Trait for patch/tool adapters. Implement to give dispatched patches a host execution target.
Register via crate::AinlRuntime::register_adapter.
Label-keyed dispatch calls Self::execute_patch with a PatchDispatchContext. The default
implementation delegates to Self::execute with the patch label and frame (back-compat for
simple adapters). The reference GraphPatchAdapter overrides Self::execute_patch to emit a
structured GraphPatch envelope (and optional host hook).
Required Methods§
Provided Methods§
Sourcefn execute_patch(&self, ctx: &PatchDispatchContext<'_>) -> Result<Value, String>
fn execute_patch(&self, ctx: &PatchDispatchContext<'_>) -> Result<Value, String>
Rich dispatch context (node id, procedural payload, frame). Override for GraphPatch-style hosts.