Expand description
Plugin registry: the single source of truth for compiled .rhai
scripts after discovery. Owns the parsed ASTs + resolved header
data. Wrapping a CompiledPlugin in a Segment adapter is the
consumer’s job (see linesmith-core’s RhaiSegment), not this
module’s.
PluginRegistry::load walks the discovery order from
super::discovery::scan_plugin_dirs, compiles each script,
resolves its @data_deps header, and extracts the required
const ID declaration. Non-fatal errors (compile failure, unknown
dep, id collision) are returned alongside the registry so
linesmith doctor can surface them; a single bad plugin does not
abort the whole load.
Structs§
- Compiled
Plugin - A single compiled plugin ready to be wrapped by a consumer-side
Segmentadapter. - Compiled
Plugin Parts - Owned-by-value view of a
CompiledPlugin’s fields, returned byCompiledPlugin::into_parts. Pure transport DTO — the non-empty-id and status-first-dep invariantscompile_pluginenforces are implicit on the values, but this struct doesn’t re-check them since callers can only obtain it by consuming a registry-builtCompiledPlugin. - Plugin
Registry - Keyed collection of compiled plugins. Lookup is by
id; iteration preserves discovery order. Non-fatal load errors (compile failure, unknown dep, id collision) live alongside the compiled plugins so post-load consumers (e.g.linesmith doctor) can query them at any point without re-running discovery.