Skip to main content

Plugin

Trait Plugin 

Source
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§

Source

fn name(&self) -> &str

Returns the name of the plugin.

Provided Methods§

Source

fn version(&self) -> &str

Returns the version of the plugin.

Source

fn description(&self) -> &str

Returns the description of the plugin.

Source

fn author(&self) -> Option<&str>

Returns the author of the plugin.

Source

fn homepage(&self) -> Option<&str>

Returns the homepage of the plugin.

Source

fn priority(&self) -> i32

Returns the priority of the plugin.

Source

fn on_init(&self, _ctx: Arc<NargoContext>, _config: &PluginConfig) -> Result<()>

Called when the plugin is initialized.

Source

fn on_pre_parse(&self, _source: &str) -> Result<Option<String>>

Called before parsing phase.

Source

fn on_parse(&self, _source: &str) -> Result<Option<String>>

Called during parsing phase.

Source

fn on_post_parse(&self, _source: &str) -> Result<Option<String>>

Called after parsing phase.

Source

fn on_pre_transform(&self, _code: &str) -> Result<Option<String>>

Called before transform phase.

Source

fn on_transform(&self, _code: &str) -> Result<Option<String>>

Called during transform phase.

Source

fn on_post_transform(&self, _code: &str) -> Result<Option<String>>

Called after transform phase.

Source

fn on_pre_bundle(&self, _bundle: &str) -> Result<Option<String>>

Called before bundle phase.

Source

fn on_bundle(&self, _bundle: &str) -> Result<Option<String>>

Called during bundle phase.

Source

fn on_post_bundle(&self, _bundle: &str) -> Result<Option<String>>

Called after bundle phase.

Source

fn on_cleanup(&self) -> Result<()>

Called during cleanup phase.

Implementors§