Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn execute(&self, ctx: &PluginContext) -> PluginResult;

    // Provided methods
    fn supports_offline(&self) -> bool { ... }
    fn requires_rpc(&self) -> bool { ... }
}
Expand description

Core trait that all built-in plugins must implement.

Required Methods§

Source

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

Plugin name (e.g., “my-custom-check”).

Source

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

Plugin version.

Source

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

Human-readable description.

Source

fn execute(&self, ctx: &PluginContext) -> PluginResult

Execute the plugin’s analysis logic and return findings.

Provided Methods§

Source

fn supports_offline(&self) -> bool

Whether this plugin can run in offline mode.

Source

fn requires_rpc(&self) -> bool

Whether this plugin requires RPC access.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§