pub struct LibraryEntry { /* private fields */ }libloading only.Expand description
An EntryProvider which loads an entry from a dynamic library file.
This uses the libloading library under the hood. It will not be available if the associated
libloading Cargo feature of clack-host is not enabled.
Implementations§
Source§impl LibraryEntry
impl LibraryEntry
Sourcepub unsafe fn load_from_path(
path: impl AsRef<OsStr>,
) -> Result<Self, PluginEntryError>
pub unsafe fn load_from_path( path: impl AsRef<OsStr>, ) -> Result<Self, PluginEntryError>
Loads a CLAP entry from a dynamic library file located at the given path.
§Errors
This function will return an error if library file could not be loaded, if the clap_entry
symbol could not be extracted from the given library, or if the symbol’s value is NULL.
§Safety
This function loads an external library object file, which is inherently unsafe, as even just loading it can trigger any behavior in your application, including Undefined Behavior.
Additionally, users
Sourcepub unsafe fn load_from_library(
library: Library,
) -> Result<Self, PluginEntryError>
pub unsafe fn load_from_library( library: Library, ) -> Result<Self, PluginEntryError>
Wraps a given Library object to load a CLAP entry from.
This function will look for the standard clap_entry symbol to get the EntryDescriptor
pointer from. If you need to load that pointer from another, non-standard symbol, see
load_from_symbol_in_library.
§Errors
This function will return an error if the clap_entry symbol could not be extracted from the given
library, or if the symbol’s value is NULL.
§Safety
Users of this function must ensure the symbol clap_entry in the given library is ABI
compatible with a pointer to an EntryDescriptor.
Sourcepub unsafe fn load_from_symbol_in_library(
library: Library,
symbol_name: &CStr,
) -> Result<Self, PluginEntryError>
pub unsafe fn load_from_symbol_in_library( library: Library, symbol_name: &CStr, ) -> Result<Self, PluginEntryError>
Wraps a given Library object to load a CLAP entry from a given symbol it contains.
§Errors
This function will return an error if the symbol could not be extracted from the given library, or if the symbol’s value is NULL.
§Safety
Users of this function must ensure the given symbol symbol_name in the given library is ABI
compatible with a pointer to an EntryDescriptor.
Trait Implementations§
Source§impl EntryProvider for LibraryEntry
impl EntryProvider for LibraryEntry
Source§fn entry_pointer(&self) -> NonNull<EntryDescriptor>
fn entry_pointer(&self) -> NonNull<EntryDescriptor>
EntryDescriptor this provides. Read more