pub enum PluginHostError {
Engine(Error),
EpochTicker(Error),
Linker(Error),
Cache(Error),
Compile(Error),
Instantiate(Error),
GrammarSpec(String),
Trap {
func: &'static str,
kind: TrapKind,
source: Error,
},
PluginGone {
func: &'static str,
},
Quarantined {
func: &'static str,
},
Boundary(String),
}Expand description
Typed error surface for the plugin host. No host path panics — every
failure mode is a value here (the four-artefact graceful-error clause).
anyhow::Error is wasmtime’s error type; each variant carries it as
#[source].
Variants§
Engine(Error)
The wasmtime engine could not be built from the host config.
EpochTicker(Error)
The epoch-ticker background thread could not be spawned (the OS refused a thread). Surfaced rather than panicked — no host-construction path panics (the “every failure mode is a value” invariant).
Linker(Error)
The component linker could not be populated with the WASI host functions (PH7.2). A host-setup failure, surfaced rather than panicked.
Cache(Error)
The on-disk module cache could not be initialised (bad directory, I/O error). A caching failure must never fail the host — callers may fall back to an uncached host — so this is surfaced, never panicked.
Compile(Error)
Component bytes were malformed or failed AOT compilation.
Instantiate(Error)
The component compiled but could not be instantiated (a missing import, or fuel exhausted during the start function).
GrammarSpec(String)
A grammar plugin declared a malformed contribution spec (PH7.7c): an
arg-spec / latency-class / surface-form that could not cross the
boundary. Fails registration loudly (the spec is structurally wrong),
unlike a runtime apply failure, which degrades gracefully to a no-op.
Trap
A lifecycle export trapped. Fuel/epoch exhaustion and genuine wasm traps all land here as a value — the call is a no-op with a typed error and the host stays live.
Fields
PluginGone
A guest call was routed to a per-plugin actor task
(picker_task) whose channel is closed — the task has ended and
dropped its Store (teardown, or a fatal error unwound the loop). The
call is a no-op with a typed error; the caller stays live. This is the
bridge’s graceful surface for “the plugin is gone”, distinct from
Trap (the plugin ran but its call failed).
Quarantined
The plugin instance is quarantined (PH7.12): a prior lifecycle / callback
call trapped, tripping crash-quarantine, so this call short-circuits
before re-entering the dead Store. Distinct from Trap
(the plugin ran and its call failed) and PluginGone
(the actor’s channel is closed): the actor is still alive, but the instance
is dead-until-reinstantiation. The PluginCrashed event already fired on
the first trap; this variant is the quiet no-op every subsequent call
returns until a reload (PH7.12b) mints a fresh instance.
Boundary(String)
A value crossing the picker boundary could not be converted between its WIT mirror and the native type — a malformed record the guest returned (e.g. a non-UTF-8 path, §4.4), or a native value with no WIT representation. Carries the boundary layer’s message. Never lossy: a conversion that cannot be represented is this typed error, not a silent drop.
Trait Implementations§
Source§impl Debug for PluginHostError
impl Debug for PluginHostError
Source§impl Display for PluginHostError
impl Display for PluginHostError
Source§impl Error for PluginHostError
impl Error for PluginHostError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PluginHostError
impl !UnwindSafe for PluginHostError
impl Freeze for PluginHostError
impl Send for PluginHostError
impl Sync for PluginHostError
impl Unpin for PluginHostError
impl UnsafeUnpin for PluginHostError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more