pub trait Plugin: Send + Sync {
// Required methods
fn metadata(&self) -> &PluginMetadata;
fn instantiate(&self) -> Box<dyn AudioNode>;
}Expand description
Host-side abstraction over a loaded plugin.
Plugin is the trait the host calls after the ABI check passes. The
loader’s own implementation ([HostPlugin]) bridges the plugin’s
extern "C" entry symbols to this trait, but consumers that build their
own plugin adapters (e.g. for in-process test plugins) may implement it
directly.
Send + Sync is required so a PluginLoader can be
moved between setup threads; instantiation produces a Box<dyn AudioNode>
(which is only Send) for the single RT thread.
Required Methods§
Sourcefn metadata(&self) -> &PluginMetadata
fn metadata(&self) -> &PluginMetadata
Static identity of this plugin (name, version, description, …).
Sourcefn instantiate(&self) -> Box<dyn AudioNode>
fn instantiate(&self) -> Box<dyn AudioNode>
Construct a fresh audio-node instance backed by this plugin.
Each call yields an independent Box<dyn AudioNode> whose lifetime is
bounded by the caller; dropping it releases the opaque handle (when the
plugin exposes audio_plugin_destroy).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".