Skip to main content

NativePlugin

Trait NativePlugin 

Source
pub trait NativePlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn process(&self, input: PluginInput) -> PluginOutput;

    // Provided method
    fn is_synth(&self) -> bool { ... }
}
Expand description

Trait for native plugins.

Required Methods§

Source

fn name(&self) -> &'static str

Plugin name.

Source

fn description(&self) -> &'static str

Plugin description.

Source

fn process(&self, input: PluginInput) -> PluginOutput

Process directives and return modified directives + errors.

Provided Methods§

Source

fn is_synth(&self) -> bool

Whether this plugin synthesizes directives the loader’s Phase::Early validation depends on (e.g. injecting Open directives so account-presence checks see them).

Plugins returning true run in the loader’s pre-booking pass; plugins returning false (the default — transformations on already-parsed directives) run post-booking so they see filled-in cost.number_per values from the booker.

This is the trait-level analogue of the loader’s PluginPass enum; the loader consults this method to classify each plugin at scheduling time, avoiding a hardcoded list of synthesizer names.

Implementors§