Struct boreal::compiler::AddRuleError
source · pub struct AddRuleError {
pub path: Option<PathBuf>,
/* private fields */
}Expand description
Error when adding a rule to a Compiler.
Fields§
§path: Option<PathBuf>The path to the file containing the error.
None if the error happens on a raw string (Compiler::add_rules_str).
Implementations§
source§impl AddRuleError
impl AddRuleError
sourcepub fn to_short_description(&self, input_name: &str, input: &str) -> String
pub fn to_short_description(&self, input_name: &str, input: &str) -> String
Convert to a displayable, single-lined description.
Arguments
input_name: a name for the input, used at the beginning of the description:<filename>:<line>:<column>: <description>.input: the input given toboreal_parser::parsethat generated the error.
sourcepub fn to_diagnostic(&self) -> Diagnostic<()>
pub fn to_diagnostic(&self) -> Diagnostic<()>
Convert to a Diagnostic.
This can be used to display the error in a more user-friendly manner than the
simple Self::to_short_description.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AddRuleError
impl Send for AddRuleError
impl Sync for AddRuleError
impl Unpin for AddRuleError
impl !UnwindSafe for AddRuleError
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