Skip to main content

PluginExecutor

Trait PluginExecutor 

Source
pub trait PluginExecutor: Send + Sync {
    // Required methods
    fn info(&self) -> &PluginInfo;
    fn method_count(&self) -> u32;
    fn call_raw(
        &self,
        method: usize,
        input: &[u8],
    ) -> Result<Vec<u8>, CallError>;
}
Expand description

The surface every execution backend shares.

Implementations must be Send + Sync: methods take &self, so a handle can be shared across threads as long as the backend is internally thread-safe.

Required Methods§

Source

fn info(&self) -> &PluginInfo

Owned metadata describing the loaded plugin.

Source

fn method_count(&self) -> u32

Number of methods the plugin exposes, in interface (vtable) order.

Source

fn call_raw(&self, method: usize, input: &[u8]) -> Result<Vec<u8>, CallError>

Raw bulk-bytes dispatch for #[wire(raw)] methods: opaque bytes in, opaque bytes out, no per-element marshalling. Opaque bytes are language-neutral (a WIT list<u8>), so this is uniform across backends.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§