pub trait PluginRuntime:
Send
+ Sync
+ 'static {
// Required method
fn load<'life0, 'async_trait>(
&'life0 self,
id: PluginId,
manifest: PluginManifest,
plugin: Arc<dyn HomeCorePlugin>,
) -> Pin<Box<dyn Future<Output = Result<LoadedPlugin, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Abstraction over the WASM (and native) plugin execution environment.
P2 will supply a WasmtimeRuntime that compiles .wasm bytes with
Cranelift; P3 adds a Wasm3Runtime for constrained targets. Both will
implement this trait so the registry is runtime-agnostic.
Required Methods§
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
id: PluginId,
manifest: PluginManifest,
plugin: Arc<dyn HomeCorePlugin>,
) -> Pin<Box<dyn Future<Output = Result<LoadedPlugin, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
id: PluginId,
manifest: PluginManifest,
plugin: Arc<dyn HomeCorePlugin>,
) -> Pin<Box<dyn Future<Output = Result<LoadedPlugin, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load a plugin from a boxed HomeCorePlugin implementation and a
parsed PluginManifest. Returns a LoadedPlugin handle.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".