Skip to main content

NativePlugin

Trait NativePlugin 

Source
pub trait NativePlugin: Send + 'static {
    // Required methods
    fn plugin_kind(&self) -> &str;
    fn register(
        &mut self,
        plugin_config: &Map<String, Json>,
        ctx: &mut PluginContext<'_>,
    ) -> Result<()>;

    // Provided methods
    fn allows_multiple_components(&self) -> bool { ... }
    fn validate(
        &self,
        _plugin_config: &Map<String, Json>,
    ) -> Vec<ConfigDiagnostic> { ... }
}
Expand description

Trait implemented by Rust native plugins.

Required Methods§

Source

fn plugin_kind(&self) -> &str

Returns the stable plugin kind.

Source

fn register( &mut self, plugin_config: &Map<String, Json>, ctx: &mut PluginContext<'_>, ) -> Result<()>

Registers runtime behavior through the component-scoped plugin context.

Provided Methods§

Source

fn allows_multiple_components(&self) -> bool

Returns whether the plugin allows multiple configured components.

Source

fn validate(&self, _plugin_config: &Map<String, Json>) -> Vec<ConfigDiagnostic>

Validates one component-local JSON config object.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§