pub trait ObserverHost {
// Required method
fn invoke(&self, ctx: &mut ObserverContext<'_>) -> Result<(), ObserverError>;
}Expand description
Capability-bounded observer host — runs a registered observer module
against a KernelEvent stream with side-effects gated by the
configured capability set.
§Backends
The runtime selects between two backends:
NoopObserverHost(always available) — pass-through that returnsOk(())without invoking any wasm.WasmtimeObserverHost(featuretier-2-observer-host-v2) — wasmtime preview-2 sandbox with fuel-metered execution + capability-boundedarkhe:observer/*host-fn dispatch.
Required Methods§
Sourcefn invoke(&self, ctx: &mut ObserverContext<'_>) -> Result<(), ObserverError>
fn invoke(&self, ctx: &mut ObserverContext<'_>) -> Result<(), ObserverError>
Invoke the observer bound to this host against the supplied
context. Implementations may inspect ctx.capabilities; they
may NOT — by construction — mutate any chain state. The return
is informational only; chain progression is unaffected.