pub enum Error {
Show 15 variants
ParseError {
location: SourceLocation,
message: String,
help: String,
},
CodeGenError {
location: SourceLocation,
message: String,
help: String,
},
UnsupportedFeature {
location: SourceLocation,
feature: String,
help: String,
},
TypeError {
location: SourceLocation,
message: String,
expected: String,
found: String,
help: String,
},
SyntaxError {
location: SourceLocation,
message: String,
help: String,
},
BinOpNotYetImplemented(BinOp),
BoolOpNotYetImplemented(BoolOp),
CompareNotYetImplemented(Compare),
ExprNotYetImplemented(Expr),
ExprTypeNotYetImplemented(ExprType),
UnknownType(String),
Pyo3Error(PyErr),
StatementNotYetImplemented(StatementType),
UnaryOpNotYetImplemented(UnaryOp),
UnknownError(Box<dyn Error>),
}
Variants§
ParseError
CodeGenError
UnsupportedFeature
TypeError
SyntaxError
BinOpNotYetImplemented(BinOp)
BoolOpNotYetImplemented(BoolOp)
CompareNotYetImplemented(Compare)
ExprNotYetImplemented(Expr)
ExprTypeNotYetImplemented(ExprType)
UnknownType(String)
Pyo3Error(PyErr)
StatementNotYetImplemented(StatementType)
UnaryOpNotYetImplemented(UnaryOp)
UnknownError(Box<dyn Error>)
Implementations§
Source§impl Error
impl Error
Sourcepub fn parsing_error(
location: SourceLocation,
message: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn parsing_error( location: SourceLocation, message: impl Into<String>, help: impl Into<String>, ) -> Self
Create a parsing error with location and helpful guidance
Sourcepub fn codegen_error(
location: SourceLocation,
message: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn codegen_error( location: SourceLocation, message: impl Into<String>, help: impl Into<String>, ) -> Self
Create a code generation error with location and helpful guidance
Sourcepub fn unsupported_feature(
location: SourceLocation,
feature: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn unsupported_feature( location: SourceLocation, feature: impl Into<String>, help: impl Into<String>, ) -> Self
Create an unsupported feature error with location and helpful guidance
Sourcepub fn type_error(
location: SourceLocation,
message: impl Into<String>,
expected: impl Into<String>,
found: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn type_error( location: SourceLocation, message: impl Into<String>, expected: impl Into<String>, found: impl Into<String>, help: impl Into<String>, ) -> Self
Create a type error with location and helpful guidance
Sourcepub fn syntax_error(
location: SourceLocation,
message: impl Into<String>,
help: impl Into<String>,
) -> Self
pub fn syntax_error( location: SourceLocation, message: impl Into<String>, help: impl Into<String>, ) -> Self
Create a syntax error with location and helpful guidance
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> ErrorContext for Twhere
T: Debug,
impl<T> ErrorContext for Twhere
T: Debug,
Source§fn with_context(&self, operation: &str) -> String
fn with_context(&self, operation: &str) -> String
Generate a standardized error message with context.