Skip to main content

PatchAdapter

Trait PatchAdapter 

Source
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§

Source

fn name(&self) -> &str

Label this adapter handles (matched against the procedural patch label).

Source

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).

Implementors§