pub trait NativeModuleFactory: Debug + 'static {
// Required methods
fn package_id(&self) -> &'static str;
fn instantiate(
&self,
context: NativeModuleFactoryContext<'_>,
) -> Result<NativeModuleInstance, RuntimeFailure>;
// Provided method
fn package_version(&self) -> &'static str { ... }
}Expand description
Adapter-specific factory for a statically linked native Rust Module.
Required Methods§
Sourcefn package_id(&self) -> &'static str
fn package_id(&self) -> &'static str
Package identity selected by the Resolved App Plan.
Sourcefn instantiate(
&self,
context: NativeModuleFactoryContext<'_>,
) -> Result<NativeModuleInstance, RuntimeFailure>
fn instantiate( &self, context: NativeModuleFactoryContext<'_>, ) -> Result<NativeModuleInstance, RuntimeFailure>
Creates a fresh Module Instance generation.
Provided Methods§
Sourcefn package_version(&self) -> &'static str
fn package_version(&self) -> &'static str
Exact statically linked Cargo package version.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".