pub trait PluginInstance:
Send
+ Sync
+ 'static {
// Required methods
fn adapter(&self) -> PluginAdapter;
fn call(&self, operation: &str, input: &[u8]) -> Result<Vec<u8>, HostError>;
// Provided method
fn health_check(&self) -> Result<(), HostError> { ... }
}Expand description
One callable plugin implementation. 一个可调用的插件实现。
Required Methods§
Sourcefn adapter(&self) -> PluginAdapter
fn adapter(&self) -> PluginAdapter
The execution adapter that backs this instance. 该实例所依托的执行适配器。
Provided Methods§
Sourcefn health_check(&self) -> Result<(), HostError>
fn health_check(&self) -> Result<(), HostError>
Confirm the instance answers a health call with exactly ok.
确认实例对 health 调用给出的回答正好是 ok。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".