AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::export::PluginExport

Trait PluginExport 

pub trait PluginExport: 'static {
    type Processor: Processor<f32> + Send + 'static;

    const PRODUCT: Product<'static>;

    // Required method
    fn create() -> Self::Processor;

    // Provided methods
    fn migrate_state(_saved: &mut SavedState) -> Result<(), StateError> { ... }
    fn import_state(_bytes: &[u8]) -> Option<SavedState> { ... }
    fn editor_message(_data: &Value) -> Option<Value> { ... }
}
Expand description

A plug-in RAVET can export: a product description and the processor behind it.

Implement it on a marker type, so any existing processor can be exported without a wrapper:

pub struct MyPlugin;
impl ravet_plugin::PluginExport for MyPlugin {
    type Processor = MyProcessor;
    const PRODUCT: Product<'static> = /* … */;
    fn create() -> MyProcessor { MyProcessor::default() }
}
ravet_plugin::export_plugin!(MyPlugin);

The processor receives parameter changes as EventData::ParameterValue events carrying the product’s host IDs and physical values, already clamped and snapped to each parameter’s range.

Required Associated Constants§

const PRODUCT: Product<'static>

The product description. It is validated when a host creates the plug-in.

Required Associated Types§

type Processor: Processor<f32> + Send + 'static

Required Methods§

fn create() -> Self::Processor

Create an unprepared processor. Called on the main thread.

Provided Methods§

fn migrate_state(_saved: &mut SavedState) -> Result<(), StateError>

Update state saved by an earlier product state version.

fn import_state(_bytes: &[u8]) -> Option<SavedState>

Convert state without the RAVET envelope, for example from an earlier framework.

fn editor_message(_data: &Value) -> Option<Value>

Handle a product-channel message from the editor on the main thread. A returned value is sent back to the editor as a product message.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§