pub struct SinglePluginEntry<P: DefaultPluginFactory> { /* private fields */ }Expand description
An Entry that only exposes a single plugin type to the host.
This is a simplified entry type, which only requires the simple DefaultPluginFactory trait to be
implemented by the user, and implements an entry and plugin factory around it.
This entry type exists purely for convenience of the users in the common case of having a single plugin type to expose to the host.
If you actually need to expose more plugin types, or to customize the entry’s behavior in some
other way, see the Entry trait documentation for an example on how to implement your own
custom entry.
§Example
use clack_plugin::entry::DefaultPluginFactory;
use clack_plugin::prelude::*;
pub struct MyPlugin;
impl Plugin for MyPlugin {
type AudioProcessor<'a> = ();
type Shared<'a> = ();
type MainThread<'a> = ();
}
impl DefaultPluginFactory for MyPlugin {
fn get_descriptor() -> PluginDescriptor {
PluginDescriptor::new("my.plugin", "My Plugin")
}
fn new_shared<'a>(
_host: HostSharedHandle<'a>
) -> Result<Self::Shared<'a>, PluginError> {
Ok(())
}
fn new_main_thread<'a>(
host: HostMainThreadHandle<'a>,
shared: &'a Self::Shared<'a>
) -> Result<Self::MainThread<'a>, PluginError> {
Ok(())
}
}
clack_export_entry!(SinglePluginEntry::<MyPlugin>);Trait Implementations§
Source§impl<P: DefaultPluginFactory> Entry for SinglePluginEntry<P>
impl<P: DefaultPluginFactory> Entry for SinglePluginEntry<P>
Source§fn new(_plugin_path: Option<&CStr>) -> Result<Self, EntryLoadError>
fn new(_plugin_path: Option<&CStr>) -> Result<Self, EntryLoadError>
Instantiates the entry. Read more
Source§fn declare_factories<'a>(&'a self, builder: &mut EntryFactories<'a>)
fn declare_factories<'a>(&'a self, builder: &mut EntryFactories<'a>)
Declares the factories this entry exposes to the host, by registering them to the given
EntryFactories builder. Read moreAuto Trait Implementations§
impl<P> Freeze for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: Freeze,
impl<P> RefUnwindSafe for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: RefUnwindSafe,
impl<P> Send for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: Send,
impl<P> Sync for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: Sync,
impl<P> Unpin for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: Unpin,
impl<P> UnsafeUnpin for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: UnsafeUnpin,
impl<P> UnwindSafe for SinglePluginEntry<P>where
PluginFactoryWrapper<SinglePluginFactory<P>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more