Torana Plugin SDK for Rust
Build a Torana plugin in Rust without writing provider-specific request
parsers. Implement the typed Plugin trait, choose your hooks, and let the
SDK handle WASM memory, protobuf framing and classified host-call errors.
Start with your first plugin. Rust 1.85+,
protoc, and the wasm32-wasip1 target are required.
[]
= ["cdylib"]
[]
= "=0.6.1"
Keep the exact version and your reviewed Cargo.lock so plugin builds remain reproducible.
use ;
;
export_plugin_v1!;
Declare the same hooks in plugin.json. Each hook has its own result family:
pass keeps input unchanged, replacement proposes a change, and an error lets
the host apply the approved failure policy. The lower-level two-argument
dispatcher macro remains available for custom dispatchers.
Plugins have no ambient filesystem or network. Model, pricing, file and HTTP
helpers address declared, operator-approved resources. execution() exposes
invocation facts, not credentials or destinations. Typed host refusals retain
stable error codes; do not branch on diagnostic strings.
The best-effort debug, info, counter, histogram and gauge helpers
use approved logging/metric imports. Void imports cannot acknowledge delivery
or report a missing permission.
Continue with the authoring reference and compiled logger example.