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§
const PACKAGE_ID: &'static str
const PACKAGE_VERSION: &'static str
const RUNTIME_PROFILE: &'static str
Required Methods§
Sourcefn link()
fn link()
Explicitly links the generated descriptor and default factory on targets without inventory constructors.
fn instantiate_with( context: NativePluginFactoryContext<'_>, initialize: &NativePluginHostBinding<Self>, ) -> Result<NativePluginInstance, RuntimeFailure>
Provided Methods§
Sourcefn instantiate_with_host_binding(
context: NativePluginFactoryContext<'_>,
initialize: Rc<NativePluginHostBinding<Self>>,
) -> Result<NativePluginInstance, RuntimeFailure>
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".