pub enum PluginError {
UnsupportedVerb(Verb),
InvalidArgs(String),
Other(String),
}Expand description
The errors a plugin can report. Deliberately only three – because the host only needs to distinguish three: the verb is not supported (so it can degrade to passing through verbatim), the arguments are wrong, and everything else. The human-readable description goes in the payload and the host prints it to stderr as-is.
Variants§
UnsupportedVerb(Verb)
This backend does not support that verb. For pmpx exec the host degrades to passing
through verbatim.
InvalidArgs(String)
Invalid arguments.
Other(String)
Anything else. Includes a plugin panic – the host only needs to know “it blew up”.
Implementations§
Source§impl PluginError
impl PluginError
Sourcepub fn unsupported_verb(verb: Verb) -> Self
pub fn unsupported_verb(verb: Verb) -> Self
Construct “unsupported verb”.
Sourcepub fn invalid_args(message: impl Into<String>) -> Self
pub fn invalid_args(message: impl Into<String>) -> Self
Construct “invalid arguments”.
Trait Implementations§
Source§impl Clone for PluginError
impl Clone for PluginError
Source§impl Debug for PluginError
impl Debug for PluginError
Source§impl Display for PluginError
impl Display for PluginError
impl Eq for PluginError
Source§impl Error for PluginError
impl Error for PluginError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&str> for PluginError
impl From<&str> for PluginError
Source§impl From<Error> for PluginError
impl From<Error> for PluginError
Source§impl From<String> for PluginError
impl From<String> for PluginError
Source§impl PartialEq for PluginError
impl PartialEq for PluginError
impl StructuralPartialEq for PluginError
Auto Trait Implementations§
impl Freeze for PluginError
impl RefUnwindSafe for PluginError
impl Send for PluginError
impl Sync for PluginError
impl Unpin for PluginError
impl UnsafeUnpin for PluginError
impl UnwindSafe 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