pub enum PluginError {
Error(Box<dyn Error + 'static>),
Message(&'static str),
}Expand description
A generic, type-erased error type for plugin-originating errors.
Errors are type-erased because the CLAP API does not support extracting error information from a plugin or host, only that an error happened.
Errors originating from a user-provided plugin implementation are simply logged through the
host’s provided logging facilities if available, or the standard error output (stderr)
if not.
This error can be constructed either from any existing Error type, or from an arbitrary
error message.
§Example
use std::io;
use clack_plugin::prelude::PluginError;
fn foo () -> io::Result<()> {
/* ... */
}
fn perform(valid: bool) -> Result<(), PluginError> {
if !valid {
return Err(PluginError::Message("Invalid value"))
}
/* ... */
foo()?;
/* ... */
Ok(())
}Variants§
Error(Box<dyn Error + 'static>)
A generic, type-erased error.
Message(&'static str)
A constant string message to be displayed.
Trait Implementations§
Source§impl Debug for PluginError
impl Debug for PluginError
Source§impl Display for PluginError
impl Display for PluginError
Source§impl<E: Error + 'static> From<E> for PluginError
impl<E: Error + 'static> From<E> for PluginError
Source§impl From<PluginError> for PluginWrapperError
impl From<PluginError> for PluginWrapperError
Source§fn from(e: PluginError) -> Self
fn from(e: PluginError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for PluginError
impl !Send for PluginError
impl !Sync for PluginError
impl !UnwindSafe for PluginError
impl Freeze for PluginError
impl Unpin for PluginError
impl UnsafeUnpin for PluginError
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