Skip to main content

NativePluginDefinition

Trait NativePluginDefinition 

Source
pub trait NativePluginDefinition: Sized + 'static {
    const PACKAGE_ID: &'static str;
    const PACKAGE_VERSION: &'static str;
    const RUNTIME_PROFILE: &'static str;

    // Required methods
    fn link();
    fn instantiate_with(
        context: NativePluginFactoryContext<'_>,
        initialize: &NativePluginHostBinding<Self>,
    ) -> Result<NativePluginInstance, RuntimeFailure>;

    // Provided method
    fn instantiate_with_host_binding(
        context: NativePluginFactoryContext<'_>,
        initialize: Rc<NativePluginHostBinding<Self>>,
    ) -> Result<NativePluginInstance, RuntimeFailure> { ... }
}
Expand description

Generated construction and endpoint projection for a struct-authored Plugin.

Host bindings may initialize private implementation state after ordinary configuration validation. They do not replace generated lifecycle or endpoints. Complete-object (v2) construction uses its asynchronous construction contract and rejects this synchronous initialization API.

Required Associated Constants§

Source

const PACKAGE_ID: &'static str

Source

const PACKAGE_VERSION: &'static str

Source

const RUNTIME_PROFILE: &'static str

Required Methods§

Explicitly links the generated descriptor and default factory on targets without inventory constructors.

Source

fn instantiate_with( context: NativePluginFactoryContext<'_>, initialize: &NativePluginHostBinding<Self>, ) -> Result<NativePluginInstance, RuntimeFailure>

Provided Methods§

Source

fn instantiate_with_host_binding( context: NativePluginFactoryContext<'_>, initialize: Rc<NativePluginHostBinding<Self>>, ) -> Result<NativePluginInstance, RuntimeFailure>

Keeps a Host binding alive through asynchronous complete-object construction.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§