Skip to main content

Module plugins

Module plugins 

Source
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 DataContextrhai::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 DataContext into the immutable rhai Map a plugin’s render(ctx) receives.
output
Validates the value a plugin’s render(ctx) function returns and converts it into a RenderedSegment the layout engine can consume.
segment
RhaiSegment — the adapter that lets a compiled .rhai plugin participate in the layout engine as a first-class crate::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 respects LINESMITH_LOG. Wraps linesmith_plugin::build_engine.