pub trait PatchAdapter: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute_patch(
&self,
ctx: &PatchDispatchContext<'_>,
) -> Result<Value, String>;
}Expand description
Label-keyed procedural patch executor. Register via crate::AinlRuntime::register_adapter.
Dispatch: crate::AinlRuntime resolves an adapter by procedural label first, then falls
back to GraphPatchAdapter::NAME when registered via crate::AinlRuntime::register_default_patch_adapters.
Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
Label this adapter handles (matched against the procedural patch label).
Sourcefn execute_patch(&self, ctx: &PatchDispatchContext<'_>) -> Result<Value, String>
fn execute_patch(&self, ctx: &PatchDispatchContext<'_>) -> Result<Value, String>
Execute the patch. Returns a JSON value the host can inspect.
Non-fatal at the runtime layer: on Err, the runtime logs and continues as a metadata
dispatch (fitness update still proceeds when applicable).