pub struct PluginError {
pub message: String,
pub source_file: Option<String>,
pub line_number: Option<u32>,
pub severity: PluginErrorSeverity,
}Expand description
Error generated by a plugin.
Use PluginError::error or PluginError::warning to create errors,
and optionally chain PluginError::at to set the source location.
§Example
use rustledger_plugin_types::{PluginError, PluginErrorSeverity};
let error = PluginError::error("Invalid transaction")
.at("ledger.beancount", 42);
let warning = PluginError::warning("Duplicate entry detected");Fields§
§message: StringError message.
source_file: Option<String>Source file (if known).
line_number: Option<u32>Line number (if known).
severity: PluginErrorSeverityError severity.
Implementations§
Trait Implementations§
Source§impl Clone for PluginError
impl Clone for PluginError
Source§fn clone(&self) -> PluginError
fn clone(&self) -> PluginError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginError
impl Debug for PluginError
Source§impl<'de> Deserialize<'de> for PluginError
impl<'de> Deserialize<'de> for PluginError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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