Struct Clap Library
pub struct ClapLibrary { /* private fields */ }Expand description
A loaded CLAP entry and bounded owned catalogue (1..1024 plugins). Optional vendor/version fields and names permit at most 4096 bytes; IDs/features 256 bytes and 128 features per plugin. Missing/duplicate IDs or invalid metadata reject the catalogue. Clack retains native code through every cloned entry and associated instance; dropping this wrapper does not unload a live instance. All operations here allocate/execute plugin code outside audio callbacks.
Implementations§
§impl ClapLibrary
impl ClapLibrary
pub fn from_entry(entry: PluginEntry) -> Result<Self, HostError>
pub fn from_entry(entry: PluginEntry) -> Result<Self, HostError>
Inspect an already-valid entry, including safe statically linked entries. Loading/initializing an entry may already have executed native code.
pub unsafe fn load(path: impl AsRef<Path>) -> Result<Self, HostError>
pub unsafe fn load(path: impl AsRef<Path>) -> Result<Self, HostError>
Load/initialize a caller-selected CLAP binary and inspect its catalogue. The path need not come from discovery; no trust decision is inferred from filename, signature, metadata or successful symbol lookup.
§Safety
The caller must ensure this native library and all its plugins comply with CLAP and its pointer/lifetime/thread contracts. Plugin code has full process access; arbitrary/noncompliant code can crash or cause undefined behavior. This API provides no sandbox, timeout, crash isolation or signing check.
pub fn plugins(&self) -> &[PluginMetadata]
pub fn find(&self, id: &CStr) -> Option<&PluginMetadata>
pub fn entry(&self) -> &PluginEntry
pub fn entry(&self) -> &PluginEntry
Access the valid entry for consumer-owned Clack host handlers, instance audio/state/editor lifecycle and extensions. Native threading/callback policies remain explicit in those APIs; this catalogue does not drive them.