AUDIO
Source snapshot · 12 October 2026

API reference / ravet_host::ClapLibrary

Struct ClapLibrary 

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

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>

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

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.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.