pub struct CompiledPlugin { /* private fields */ }Expand description
A single compiled plugin ready to be wrapped by a consumer-side
Segment adapter.
Field visibility is pub(crate) — the registry is the only
factory (compile_plugin is the sole construction site), and
the only mutator. This keeps the non-empty-id, status-first-dep,
non-reserved-dep invariants the factory enforces from being
silently violated by a third-party caller that constructs the
struct directly. Field accessors are pub for consumers.
declared_deps is a raw Vec<String> of the header-declared dep
tokens (always with "status" first). The consumer maps these
back to its own dep enum at registration time and is responsible
for any &'static promotion required by its Segment trait.
Construction runs the script’s top-level statements once to
extract const ID; plugin authors with side effects at module
scope pay that cost at registry build, not at first render.
Implementations§
Source§impl CompiledPlugin
impl CompiledPlugin
pub fn id(&self) -> &str
pub fn path(&self) -> &Path
pub fn declared_deps(&self) -> &[String]
Sourcepub fn into_parts(self) -> CompiledPluginParts
pub fn into_parts(self) -> CompiledPluginParts
Consume the plugin, yielding its constituent fields as a
named-field CompiledPluginParts. Used by consumer-side
Segment adapters that need to take ownership of the AST
and the dep list. Named fields keep the call site readable
and let new fields be added without breaking destructures.