Skip to main content

ObserverHost

Trait ObserverHost 

Source
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 returns Ok(()) without invoking any wasm.
  • WasmtimeObserverHost (feature tier-2-observer-host-v2) — wasmtime preview-2 sandbox with fuel-metered execution + capability-bounded arkhe:observer/* host-fn dispatch.

Required Methods§

Source

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.

Implementors§