Expand description
Tool plugins: WebAssembly components, each of which knows one tool.
doris embeds a plugin for each tool it ships with, and loads more from
the directories the plugins.path setting names. Both go through the
same path. A plugin exports the tool interface of wit/plugin.wit and
one interface for each capability it provides; which, doris finds out
from what it exports.
A plugin is instantiated afresh for every call, so calls share nothing
and can be made from any thread. It has no WASI: all it can do beyond
computing is what the host interface allows, and that only while a
step runs (see Scope).
Compiling a component to machine code takes a while, so the compiled code is kept in the per-user cache directory, keyed by the component’s hash and the engine’s settings.
Re-exports§
pub use doris::plugin::types;pub use exports::doris::plugin::coverage_reporter;pub use exports::doris::plugin::crossing_checker;pub use exports::doris::plugin::linter;pub use exports::doris::plugin::reference_model;pub use exports::doris::plugin::simulator;pub use exports::doris::plugin::sources;pub use exports::doris::plugin::tool;
Modules§
Structs§
- Call
- A plugin, instantiated for one call.
- Doris
- Auto-generated bindings for an instance a component which
implements the world
doris. - Doris
Indices - Auto-generated bindings for index of the exports of
doris. - Doris
Pre - Auto-generated bindings for a pre-instantiated version of a
component which implements the world
doris. - Hash
Writer 🔒 - Feeds a
Hashinto a SHA-256. - Plugin
- One plugin, compiled and linked, ready to instantiate.
- Registry
- Every plugin doris has: the embedded ones, then those in the plugin directories.
- Scope
- What a plugin may touch while one of its callbacks runs: files in the job’s directory, to read, and in the step’s, to write. A relative path is relative to the step’s directory. Outside a callback a plugin has no scope, and no files.
- State
- What a plugin’s store holds: its scope, if a callback is running.
Enums§
- Origin
- Where a plugin came from.
Statics§
- DIRS 🔒
Traits§
- Anyhow 🔒
- A wasmtime result as one of doris’s.
Functions§
- compile 🔒
- The component
bytes, compiled: from the cache of compiled plugins if it is there, and put there if not. A cache that can’t be used only costs the compile. - engine 🔒
- The engine every plugin is compiled for.
- hex 🔒
- lacks 🔒
- An error that the plugin lacks a capability.
- registry
- The plugins, loaded the first time they are asked for.
- set_
dirs - The directories the
plugins.pathsetting names. Only the first call counts: settings are read once per command.