pub trait Plugin: Send + Sync {
Show 17 methods
// Required method
fn name(&self) -> &str;
// Provided methods
fn version(&self) -> &str { ... }
fn description(&self) -> &str { ... }
fn author(&self) -> Option<&str> { ... }
fn homepage(&self) -> Option<&str> { ... }
fn priority(&self) -> i32 { ... }
fn on_init(
&self,
_ctx: Arc<NargoContext>,
_config: &PluginConfig,
) -> Result<()> { ... }
fn on_pre_parse(&self, _source: &str) -> Result<Option<String>> { ... }
fn on_parse(&self, _source: &str) -> Result<Option<String>> { ... }
fn on_post_parse(&self, _source: &str) -> Result<Option<String>> { ... }
fn on_pre_transform(&self, _code: &str) -> Result<Option<String>> { ... }
fn on_transform(&self, _code: &str) -> Result<Option<String>> { ... }
fn on_post_transform(&self, _code: &str) -> Result<Option<String>> { ... }
fn on_pre_bundle(&self, _bundle: &str) -> Result<Option<String>> { ... }
fn on_bundle(&self, _bundle: &str) -> Result<Option<String>> { ... }
fn on_post_bundle(&self, _bundle: &str) -> Result<Option<String>> { ... }
fn on_cleanup(&self) -> Result<()> { ... }
}Expand description
Plugin trait for extending Nargo functionality.
Required Methods§
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Returns the description of the plugin.
Returns the author of the plugin.
Sourcefn on_init(&self, _ctx: Arc<NargoContext>, _config: &PluginConfig) -> Result<()>
fn on_init(&self, _ctx: Arc<NargoContext>, _config: &PluginConfig) -> Result<()>
Called when the plugin is initialized.
Sourcefn on_pre_transform(&self, _code: &str) -> Result<Option<String>>
fn on_pre_transform(&self, _code: &str) -> Result<Option<String>>
Called before transform phase.
Sourcefn on_post_transform(&self, _code: &str) -> Result<Option<String>>
fn on_post_transform(&self, _code: &str) -> Result<Option<String>>
Called after transform phase.
Sourcefn on_cleanup(&self) -> Result<()>
fn on_cleanup(&self) -> Result<()>
Called during cleanup phase.