pub trait Plugin: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn name(&self) -> &str;
fn version(&self) -> &str;
fn description(&self) -> &str;
fn author(&self) -> &str;
fn category(&self) -> PluginCategory;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn api_version(&self) -> &str { ... }
fn validate(&self) -> Result<(), PluginError> { ... }
}Expand description
Extension contract for source-linked native plugins.
Implementations record observations through PluginContext::record and
use PluginContext::request for host-authorized network work. Successful
completion grants no finding or verification authority.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description.
Human-readable author or owner.
Sourcefn category(&self) -> PluginCategory
fn category(&self) -> PluginCategory
Informational plugin category.
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes one host-authorized invocation.
Provided Methods§
Sourcefn api_version(&self) -> &str
fn api_version(&self) -> &str
Plugin API line targeted by this implementation.
Sourcefn validate(&self) -> Result<(), PluginError>
fn validate(&self) -> Result<(), PluginError>
Validates static plugin prerequisites before registration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".