pub trait PluginRuntime {
type Instance;
type Error: Error;
// Required methods
fn adapter(&self) -> PluginAdapter;
fn load(
&self,
manifest: PluginManifest,
bytes: &[u8],
) -> Result<Self::Instance, Self::Error>;
}Expand description
Generic execution backend for a plugin artifact. 插件工件的泛型执行后端。
The associated instance keeps dispatch static: a native, WASM, or process adapter can be selected by the host without putting every plugin implementation behind one global trait object. 使用关联类型保持静态分发:宿主可以选择 native、WASM 或进程适配器, 不必把所有插件实现塞进一个全局 trait object。
Required Associated Types§
Required Methods§
Sourcefn adapter(&self) -> PluginAdapter
fn adapter(&self) -> PluginAdapter
Report which isolation mode this runtime provides. 报告本运行时所提供的隔离方式。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".