Skip to main content

PluginFfi

Trait PluginFfi 

Source
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§

Source

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).

Source

fn apply_filter( &self, filter_id: RStr<'_>, frame: FilterFrame<'_>, ) -> FfiResult<()>

Applies the CPU filter filter_id to frame in place.

Source

fn shutdown(&self)

Releases resources. No other method is called afterwards.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'lt, _ErasedPtr> PluginFfi for PluginFfi_TO<'lt, _ErasedPtr>
where Self: Send + Sync, _ErasedPtr: AsPtr<PtrTarget = ()>,