Expand description
Plugin runtime bridge layer.
The rhai-pure plugin host (engine construction, discovery,
registry, @data_deps header parsing, error types) lives in
linesmith_plugin per ADR-0018 / ADR-0020 — consumers reach
those types from that crate directly, not through this module.
What lives here is the consumer-side bridge: the
RhaiSegment adapter that lets compiled plugins implement the
Segment trait, the build_ctx DataContext → rhai::Map
mirror, validate_return which decodes a plugin’s rhai::Map
into a crate::segments::RenderedSegment, and the
build_engine wrapper that installs a LINESMITH_LOG-respecting
warn emitter before delegating to linesmith_plugin::build_engine.
Re-exports§
pub use ctx_mirror::build_ctx;pub use output::validate_return;pub use segment::RhaiSegment;
Modules§
- ctx_
mirror - Converts a
DataContextinto the immutable rhaiMapa plugin’srender(ctx)receives. - output
- Validates the value a plugin’s
render(ctx)function returns and converts it into aRenderedSegmentthe layout engine can consume. - segment
RhaiSegment— the adapter that lets a compiled.rhaiplugin participate in the layout engine as a first-classcrate::segments::Segment.
Functions§
- build_
engine - Build the rhai plugin engine with linesmith-core’s logger wired
as the host’s warn emitter, so plugin
log()output respectsLINESMITH_LOG. Wrapslinesmith_plugin::build_engine.