Trait Plugin Export
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§
Required Associated Types§
Required Methods§
Provided Methods§
fn migrate_state(_saved: &mut SavedState) -> Result<(), StateError>
fn migrate_state(_saved: &mut SavedState) -> Result<(), StateError>
Update state saved by an earlier product state version.
fn import_state(_bytes: &[u8]) -> Option<SavedState>
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>
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".