pub trait PluginFfi: Send + Sync {
// Required methods
fn handle_event(&self, event_json: RStr<'_>) -> FfiResult<RString>;
fn apply_filter(
&self,
filter_id: RStr<'_>,
frame: FilterFrame<'_>,
) -> FfiResult<()>;
fn shutdown(&self);
}Expand description
A live plugin instance.
Created by PluginModule::create. The host calls handle_event on its
UI thread with no host locks held, and apply_filter on render worker
threads (possibly concurrently for different panes).
Required Methods§
Sourcefn handle_event(&self, event_json: RStr<'_>) -> FfiResult<RString>
fn handle_event(&self, event_json: RStr<'_>) -> FfiResult<RString>
Handles a JSON-encoded crate::protocol::HostEvent and returns a
JSON response (null when the event has none).
Sourcefn apply_filter(
&self,
filter_id: RStr<'_>,
frame: FilterFrame<'_>,
) -> FfiResult<()>
fn apply_filter( &self, filter_id: RStr<'_>, frame: FilterFrame<'_>, ) -> FfiResult<()>
Applies the CPU filter filter_id to frame in place.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".