pub enum LemmaError {
Parse(Box<ErrorDetails>),
Semantic(Box<ErrorDetails>),
Inversion(Box<ErrorDetails>),
Runtime(Box<ErrorDetails>),
Engine(Box<ErrorDetails>),
MissingFact(Box<ErrorDetails>),
CircularDependency {
details: Box<ErrorDetails>,
cycle: Vec<Source>,
},
ResourceLimitExceeded {
limit_name: String,
limit_value: String,
actual_value: String,
suggestion: String,
},
MultipleErrors(Vec<LemmaError>),
}Expand description
Error types for the Lemma system with source location tracking
Variants§
Parse(Box<ErrorDetails>)
Parse error with source location
Semantic(Box<ErrorDetails>)
Semantic validation error with source location
Inversion(Box<ErrorDetails>)
Inversion error (valid Lemma, but unsupported by inversion) with source location
Runtime(Box<ErrorDetails>)
Runtime error during evaluation with source location
Engine(Box<ErrorDetails>)
Engine error with source location
MissingFact(Box<ErrorDetails>)
Missing fact error during evaluation with source location
CircularDependency
Circular dependency error with source location and cycle information
ResourceLimitExceeded
Resource limit exceeded
MultipleErrors(Vec<LemmaError>)
Multiple errors collected together
Implementations§
Source§impl LemmaError
impl LemmaError
Sourcepub fn parse(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn parse( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a parse error with source information
Sourcepub fn parse_with_suggestion(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: impl Into<String>,
) -> Self
pub fn parse_with_suggestion( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: impl Into<String>, ) -> Self
Create a parse error with suggestion
Sourcepub fn semantic(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn semantic( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a semantic error with source information
Sourcepub fn semantic_with_suggestion(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: impl Into<String>,
) -> Self
pub fn semantic_with_suggestion( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: impl Into<String>, ) -> Self
Create a semantic error with suggestion
Sourcepub fn inversion(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn inversion( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create an inversion error with source information
Sourcepub fn inversion_with_suggestion(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: impl Into<String>,
) -> Self
pub fn inversion_with_suggestion( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: impl Into<String>, ) -> Self
Create an inversion error with suggestion
Sourcepub fn engine(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn engine( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create an engine error with source information
Sourcepub fn missing_fact(
fact_path: FactPath,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn missing_fact( fact_path: FactPath, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a missing fact error with source information
Sourcepub fn missing_rule(
rule_path: RulePath,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn missing_rule( rule_path: RulePath, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a missing rule error with source information
Sourcepub fn missing_type(
type_name: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn missing_type( type_name: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a missing type error with source information
Sourcepub fn missing_doc(
doc_name: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
current_doc_name: impl Into<String>,
doc_start_line: usize,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn missing_doc( doc_name: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, current_doc_name: impl Into<String>, doc_start_line: usize, suggestion: Option<impl Into<String>>, ) -> Self
Create a missing document error with source information
Sourcepub fn circular_dependency(
message: impl Into<String>,
span: Span,
attribute: impl Into<String>,
source_text: Arc<str>,
doc_name: impl Into<String>,
doc_start_line: usize,
cycle: Vec<Source>,
suggestion: Option<impl Into<String>>,
) -> Self
pub fn circular_dependency( message: impl Into<String>, span: Span, attribute: impl Into<String>, source_text: Arc<str>, doc_name: impl Into<String>, doc_start_line: usize, cycle: Vec<Source>, suggestion: Option<impl Into<String>>, ) -> Self
Create a circular dependency error with source information
Source§impl LemmaError
impl LemmaError
Trait Implementations§
Source§impl Clone for LemmaError
impl Clone for LemmaError
Source§fn clone(&self) -> LemmaError
fn clone(&self) -> LemmaError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LemmaError
impl Debug for LemmaError
Source§impl Display for LemmaError
impl Display for LemmaError
Source§impl Error for LemmaError
impl Error for LemmaError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for LemmaError
impl RefUnwindSafe for LemmaError
impl Send for LemmaError
impl Sync for LemmaError
impl Unpin for LemmaError
impl UnwindSafe for LemmaError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more