Skip to main content

PluginClient

Trait PluginClient 

Source
pub trait PluginClient:
    Send
    + Sync
    + 'static {
    // Required methods
    fn call(&self, method: &str, request: &[u8]) -> Result<Bytes, String>;
    fn shutdown(&self);
}
Expand description

One loaded plugin, native or test double.

Required Methods§

Source

fn call(&self, method: &str, request: &[u8]) -> Result<Bytes, String>

Blocking RPC call: request JSON in, response envelope out.

Source

fn shutdown(&self)

Releases the plugin. Called once, after every call has returned.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PluginClient for NativeClient

Available on Unix only.