Skip to main content

Module handler

Module handler 

Source
Expand description

The LexHandler trait — the protocol’s source of truth.

Native handlers (built-ins, in-process Rust embedders) impl this trait directly. Subprocess and WASM transports are delivered as generic adapters that impl the same trait by serialising calls to JSON-RPC or component imports respectively.

Methods that produce non-trivial output return Result<Option<T>, HandlerError>. The Result distinguishes “I hit an error you should surface as a diagnostic” from “I succeeded but have nothing to contribute”; the inner Option/Vec covers the latter. LexHandler::on_label returns () because it is a notification.

Enums§

HandlerError
Errors a LexHandler method can surface.

Traits§

LexHandler
The hook-event interface a Lex extension implements.