Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn descriptor(&self) -> PluginDescriptor;
    fn build(
        &self,
        context: PluginContext,
    ) -> PluginResult<Arc<dyn PluginProvider>>;

    // Provided method
    fn capabilities(&self) -> PluginCapabilities { ... }
}
Expand description

Factory contract for a compiled-in plugin.

Required Methods§

Source

fn descriptor(&self) -> PluginDescriptor

Return plugin identity before construction.

Source

fn build(&self, context: PluginContext) -> PluginResult<Arc<dyn PluginProvider>>

Build the provider using host-curated capabilities.

Provided Methods§

Source

fn capabilities(&self) -> PluginCapabilities

Declare what this plugin needs beyond the note APIs.

Default: nothing. The host validates the declaration and binds it to this plugin’s crate::VaultApi before construction, so a capability is scoped to the plugin that asked for it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§