pub trait PluginExport: Plugin + Sized {
type Params: Params;
// Required methods
fn create() -> Self;
fn params(&self) -> &Self::Params;
fn params_mut(&mut self) -> &mut Self::Params;
fn params_arc(&self) -> Arc<Self::Params>;
}Expand description
Unified export trait for all plugin formats.
Implement this once on your plugin type. All format wrappers (CLAP, VST3, AU, standalone) use this to construct your plugin and access its parameters.
ⓘ
impl PluginExport for MyPlugin {
type Params = MyParams;
fn create() -> Self { Self::new() }
fn params(&self) -> &MyParams { &self.params }
fn params_mut(&mut self) -> &mut MyParams { &mut self.params }
}Required Associated Types§
Required Methods§
Sourcefn params_mut(&mut self) -> &mut Self::Params
fn params_mut(&mut self) -> &mut Self::Params
Mutable access to the parameter struct.
Sourcefn params_arc(&self) -> Arc<Self::Params>
fn params_arc(&self) -> Arc<Self::Params>
Get a shared Arc reference to the parameter struct.
Used by format wrappers to pass params to GUI closures without raw pointers. The Arc is cloned (cheap ref-count bump), not the params themselves.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.